Outlook Visual Basic Help has been installed

The Visual Basic Help file for Microsoft Outlook has already been installed. You do not need to install it from the ValuPack.


CreateObject Method

Creates an Automation object of the specified class.

Note   Use this method if you are automating Microsoft Outlook by using VBScript. Use the CreateObject function if you are automating Microsoft Outlook by using Visual Basic for Applications in another application.

Syntax

objApplication.CreateObject(ObjectName)

objApplication    Required. An expression that returns an Application object.

ObjectName   Required String. The class name of the object to create. For information about valid class names, see OLE Programmatic Identifiers.


IsWordMail Method

Determines whether the mail message associated with an inspector is displayed in an Outlook Inspector or in Microsoft Word. Returns True if the mail message is displayed in Microsoft Word (that is, if Word Mail is in use).

Syntax

objInspector.IsWordMail

objInspector    Required. An expression that returns an Inspector object.


OLE Programmatic Identifiers (Microsoft Outlook)

You use an OLE programmatic identifier (sometimes called a ProgID) to create an Automation object.

To create an Automation object that represents the Microsoft Outlook Application object, use "Outlook.Application". Using "Outlook.Application" creates an Application object that represents the most recent version of Microsoft Outlook that is available on the machine where the macro is running.


Organizer Property

Returns the name of the organizer of the appointment.

Read-only String.

Syntax

objAppointmentItem.Organizer

objAppointmentItem    Required. An expression that returns an AppointmentItem object.


Microsoft Outlook Objects


Microsoft Outlook Constants

When you automate Microsoft Outlook by using an Automation object in an application that supports Visual Basic for Applications, you can use built-in constants to specify property and argument values.

However, when you automate Microsoft Outlook by using VBScript, you must use the numeric values that the constants represent. The following tables list the built-in Microsoft Outlook constants and their numeric values.

OlActionCopyLike

Constant	Value
olReply	0
olReplyAll	1
olForward	2
olReplyFolder	3
olRespond	4
OlActionReplyStyle

Constant	Value
olOmitOriginalText	0
olEmbedOriginalItem	1
olIncludeOriginalText	2
olIndentOriginalText	3
olLinkOriginalItem	4
olUserPreference	5
olReplyTickOriginalText	1000
OlActionResponseStyle

Constant	Value
olOpen	0
olSend	1
olPrompt	2
OlActionShowOn

Constant	Value
olDontShow	0
olMenu	1
olMenuAndToolbar	2
OlAttachmentType

Constant	Value
olByValue	1
olByReference	4
olEmbeddedItem	5
olOLE	6
OlBusyStatus

Constant	Value
olFree	0
olTentative	1
olBusy	2
olOutOfOffice	3
OlDaysOfWeek

Constant	Value
olSunday	1
olMonday	2
olTuesday	4
olWednesday	8
olThursday	16
olFriday	32
olSaturday	64
OlDefaultFolders

Constant	Value
olFolderDeletedItems	3
olFolderOutbox	4
olFolderSentMail	5
olFolderInbox	6
olFolderCalendar	9
olFolderContacts	10
olFolderDrafts	16
olFolderJournal	11
olFolderNotes	12
olFolderTasks	13
OlDisplayType

Constant	Value
olAgent	3
olDistList	1
olForum	2
olOrganization	4
olPrivateDistList	5
olRemoteUser	6
olUser	0
OlFieldType

Constant	Value
vbArray	12
vbBlob	11
vbBoolean	9
vbCurrency	6
vbDataObject	10
vbDate	7
vbDouble	5
vbEmpty	0
vbInteger	2
vbLong	3
vbNull	1
vbSingle	4
vbString	8

OlFlagStatus

Constant	Value
olNoFlag	0
olFlagComplete	1
olFlagMarked	2

OlFolderDisplayMode

Constant	Value
olFolderDisplayNormal	0
olFolderDisplayFolderOnly	1
olFolderDisplayNoNavigation	2
OlFormRegistry

Constant	Value
olDefaultRegistry	0
olPersonalRegistry	2
olFolderRegistry	3
olOrganizationRegistry	4
OlGender

Constant	Value
olUnspecified	0
olFemale	1
olMale	2
OlImportance

Constant	Value
olImportanceLow	0
olImportanceNormal	1
olImportanceHigh	2
OlInspectorClose

Constant	Value
olSave	0
olDiscard	1
olPromptForSave	2
OlItemType

Constant	Value
olMailItem	0
olAppointmentItem	1
olContactItem	2
olTaskItem	3
olJournalItem	4
olNoteItem	5
olPostItem	6
OlJournalRecipientType

Constant	Value
olAssociatedContact	1
OlMailingAddress

Constant	Value
olNone	0
olHome	1
olBusiness	2
olOther	3
OlMailRecipientType

Constant	Value
olOriginator	0
olTo	1
olCC	2
olBCC	3
OlMeetingRecipientType

Constant	Value
olOrganizer	0
olRequired	1
olOptional	2
olResource	3
OlMeetingResponse

Constant	Value
olMeetingTentative	2
olMeetingAccepted	3
olMeetingDeclined	4
OlMeetingStatus

Constant	Value
olNonMeeting	0
olMeeting	1
olMeetingReceived	3
olMeetingCanceled	5
OlMeetingType

Constant	Value
olRequest	0
olResponse	1
OlNetMeetingType

Constant	Value
olChat	1
olNetMeeting	0
olNetShow	2
OlNoteColor

Constant	Value
olBlue	0
olGreen	1
olPink	2
olYellow	3
olWhite	4
OlObjectClass

Constant	Value
olAction	32
olActions	33
olAddressEntries	21
olAddressEntry	8
olAddressList	7
olAddressLists	20
olApplication	0
olAppointment	26
olAttachment	5
olAttachments	18
olContact	40
olDocument	41
olException	30
olExceptions	29
olExplorer	34
olFolder	2
olFolders	15
olFormDescription	37
olInspector	35
olItems	16
olJournal	42
olMail	43
olMeetingCancellation	54
olMeetingRequest	53
olMeetingResponseNegative	55
olMeetingResponsePositive	56
olMeetingResponseTentative	57
olNamespace	1
olNote	44
olPages	36
olPost	45
olRecipient	4
olRecipients	17
olRecurrencePattern	28
olRemote	47
olReport	46
olTask	48
olTaskRequest	49
olTaskRequestAccept	51
olTaskRequestDecline	52
olTaskRequestUpdate	50
olUserProperties	38
olUserProperty	39
OlRecipientType

Constant	Value
olRecipientBcc	3
olRecipientCc	2
olRecipientOriginator	0
olRecipientTo	1
OlRecurrenceState

Constant	Value
olApptException	3
olApptMaster	1
olApptNotRecurring	0
olApptOccurrence	2
OlRecurrenceType

Constant	Value
olRecursDaily	0
olRecursWeekly	1
olRecursMonthly	2
olRecursMonthNth	3
olRecursYearly	5
olRecursYearNth	6
OlRemoteStatus

Constant	Value
olRemoteStatusNone	0
olUnMarked	1
olMarkedForDownload	2
olMarkedForCopy	3
olMarkedForDelete	4
OlResponseStatus

Constant	Value
olResponseNone	0
olResponseOrganized	1
olResponseTentative	2
olResponseAccepted	3
olResponseDeclined	4
olResponseNotResponded	5
OlSaveAsType

Constant	Value
olTXT	0
olRTF	1
olTemplate	2
olMSG	3
olDoc	4
olHTML	5
olVCard	6
olVCal	7
OlSensitivity

Constant	Value
olNormal	0
olPersonal	1
olPrivate	2
olConfidential	3
OlSortOrder

Constant	Value
olAscending	1
olDescending	2
olSortNone	0
OlTaskDelegationState

Constant	Value
olTaskNotDelegated	0
olTaskDelegationUnknown	1
olTaskDelegationAccepted	2
olTaskDelegationDeclined	3
OlTaskOwnership

Constant	Value
olNewTask	0
olDelegatedTask	1
olOwnTask	2
OlTaskRecipientType

Constant	Value
olUpdate	1
olFinalStatus	2
OlTaskResponse

Constant	Value
olTaskSimple	0
olTaskAssign	1
olTaskAccept	2
olTaskDecline	3
OlTaskStatus

Constant	Value
olTaskNotStarted	0
olTaskInProgress	1
olTaskComplete	2
olTaskWaiting	3
olTaskDeferred	4
OlTrackingStatus

Constant	Value
olTrackingNone	0
olTrackingDelivered	1
olTrackingNotDelivered	2
olTrackingNotRead	3
olTrackingRecallFailure	4
olTrackingRecallSuccess	5
olTrackingRead	6
olTrackingReplied	7
OlUserPropertyType

Constant	Value
olText	1
olNumber	3
olDateTime	5
olYesNo	6
olDuration	7
olKeywords	11
olPercent	12
olCurrency	14
olFormula	18
olCombination	19


Help Topic Not Available

The Help topic cannot be displayed because Visual Basic for Applications Help cannot be found or was not installed.

To install Visual Basic for Applications Help

1.	Run Microsoft Office 97 Setup, and click Add/Remove.

2.	Click Microsoft Outlook, and then click Change Option.

3.	Make sure that the Microsoft Outlook Program Files check box is selected.

4.	Continue with Setup.


Help topic not available

The Help topic cannot be displayed because Microsoft Office Visual Basic Help cannot be found or was not installed.

To install Visual Basic for Applications Help

1.	Run Microsoft Office 97 Setup, and click Add/Remove.

2.	Click Microsoft Outlook, and then click Change Option.

3.	Make sure that the Microsoft Outlook Program Files check box is selected.

4.	Continue with Setup.


Add Method

Adds an object to a collection. Select one of the following collections to see a detailed description of the Add method for that collection.

Actions

AddressEntries

Attachments

Folders

Items

Pages

Recipients

UserProperties


Add Method (Attachments Collection)

Creates a new attachment in the Attachments collection, and returns the new attachment as an Attachment object.

Syntax

objAttachments.Add(Source, [Type], [Position], [DisplayName])

objAttachments   Required. An expression that returns an Attachments collection object.

Source   Required String. The file (represented by the full path and file name) or item that constitutes the attachment.

Type   Optional Long. The type of attachment. Can be one of the following OlAttachmentType constants: olByReference, olByValue, olEmbeddedItem, or olOLE.

Position   Optional Long. The position of the attachment within the body text of the message.

DisplayName   Optional String. The display name of the attachment.


Add Method (Attachments Object) Example

This example creates a new mail message, attaches a Microsoft Excel workbook as an attachment (not a link) and gives the attachment a descriptive caption.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAttachments = myItem.Attachments

myAttachments.Add "C:\My Documents\Q496.xls", _

    olByValue, 1, "4th Quarter 1996 Results Chart"

This example creates a new mail message and attaches a Microsoft Word document from a server using a link.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAttachments = myItem.Attachments

myAttachments.Add "\\MYSVR1\Reports\Q496Report.doc", _

    olByReference

This example creates a new mail message and attaches the first contact in the default Contacts folder.

Set myFolder = _

    myNameSpace.GetDefaultFolder(olFolderContacts)

Set myFirstContact = myFolder.Items(1)

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAttachments = myItem.Attachments

myAttachments.Add myFirstContact


Add Method (Items Object)

Creates a new Outlook item in the Items collection for the folder, and returns the new item. If not specified, the type of the item defaults to the type of the folder, or to MailItem if the parent folder is not typed.

Syntax

objItems.Add([Type])

objItems   Required. An expression that returns an Items collection object.

Type   Optional. Variant. The Outlook item type for the new item. Can be one of the following OlItemType constants: olAppointmentItem, olContactItem, olJournalItem, olMailItem, olNoteItem, olPostItem, or olTaskItem or any valid message class. Specify the message class to create customs forms.


Add Method (Items Object) Example

This example gets the current Contacts folder and adds a new ContactItem object to it.

Set myFolder = _

    myNamespace.GetDefaultFolder(olFolderContacts)

Set myItem = myFolder.Items.Add

This example adds a custom form to the default Tasks folder.

Set myFolder = _

    myNamespace.GetDefaultFolder(olFolderTasks)

Set myItems = myFolder.Items

Set myItem = myItems.Add("IPM.Task.myTask")


Add Method (Pages Collection)

Creates a new page in the Pages collection, and returns the new page. The Pages collection is initially empty and there is a limit of 5 customizable pages per collection.

Syntax

objPages.Add(Name)

objPages    Required. An expression that returns a Pages collection object.

Name   Required. String. The name of the page.


Add Method (Pages Collection) Example

This example returns a new custom page named "My Page" (the same call without a name will return the next available page for customization — for example, “Custom1”).

Set myPages = myItem.GetInspector.ModifiedFormPages

Set myPage = myPages.Add("My Page")

This example returns the Message page of a MailItem.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myPages = myItem.GetInspector.ModifiedFormPages

Set myPage = myPages.Add("Message")

This example returns the General (main) page of a ContactItem.

Set myItem = myOlApp.CreateItem(olContactItem)

Set myPages = myItem.GetInspector.ModifiedFormPages

Set myPage = myPages.Add("General")


Add Method (UserProperties Collection)

Creates a new user property in the UserProperties collection, and returns the new property as a UserProperty object.

Syntax

objUserProperties.Add(Name, Type, [AddToFolderFields], [DisplayFormat])

objUserProperties    Required. An expression that returns a UserProperties object.

Name   Required String. The name of the property.

Type   Required Long. The type of the property. Can be one of the following OlUserPropertyType constants: olCombination, olCurrency, olDateTime, olDuration, olFormula, olKeywords, olNumber, olPercent, olText, or olYesNo.

AddToFolderFields   Optional Boolean. True if the property will be added to the folder fields, False if not. The default value is True.

DisplayFormat   Optional Long. The index of the format of the specified OlUserPropertyType constant. For more information, see the "Remarks" section.

Remarks

To look up the index of a format to specify for the DisplayFormat argument, follow these steps.

1	Open a new item.

2	On the Tools menu, select Forms, click Design This Form.

3	Click an empty page. If the Field Chooser is not displayed, click the Field Chooser button on the toolbar.

4	In the Field Chooser, click the New button.

5	In the New Field dialog box, select the appropriate field type in the Type box, and then find the format you want in the Format box. The index of the format corresponds to its position in this list.


Add Method (UserProperties Collection) Example

This example creates a new ContactItem object and adds “LastDateSpokenWith” as a user property.

Set myItem = myOlApp.CreateItem(olContactItem)

Set myUserProperty = myItem.UserProperties _

    .Add("LastDateSpokenWith", olDateTime)


DisplayName Property

Returns or sets the name, which need not be the actual file name, displayed below the icon representing the embedded attachment. This property corresponds to the MAPI property PR_DISPLAY_NAME.

Read/write String.

Syntax

object.DisplayName

object    Required. An expression that returns an Attachment or FormDescription object.


Find Method

Items collection object: Applies the filter to the Items collection and returns the first Item object matching the filter.

UserProperties collection object: Locates and returns a UserProperty object for the requested property name, if it exists.

Syntax 1

object.Find(Filter)

Syntax 2

object.Find(Name, Custom)

object   Required. An expression that returns an Items object (Syntax 1) or a UserProperties object (Syntax 2).

Filter   Required String. An expression that will evaluate to True or False.

The filter is a string expression containing one or more filter clauses joined by the logical operators And, Not, and Or.

A filter clause is a simple expression that evaluates to True or False; for example, [CompanyName] = "Microsoft".

Note that property names can be used in the expression and are identified and delimited by square brackets. Except for these bracketed property names, only literals are allowed within the expression — variables and constants are not evaluated.

Comparison operators allowed within the filter expression include >, <, >=, <=, = and <>.

Logical operators allowed are And, Not and Or.

Name   Required. String. The display name of the requested property.

Custom   Optional. Boolean. True if the requested property is a user (custom) property. False if it is a system property. The default value is True.

Remarks

For the UserProperties collection, Find cannot be used, and will cause an error, with the following properties:

Class ConversationIndex Email1EntryID Email2EntryID Email3EntryID EntryID ReceivedByEntryID	ReceivedOnBehalfOfEntryID ResponseState Saved Unread UserCertificate VotingOptions

For the Items collection, Find cannot be used, and will cause an error, with the following properties:

Categories Children Class Companies CompanyLastFirstNoSpace CompanyLastFirstSpaceOnly Contacts IsOnlineMeeting LastFirstAndSuffix LastFirstNoSpace	LastFirstNoSpaceCompany LastFirstSpaceOnly LastFirstSpaceOnlyCompany NetMeetingAlias NetMeetingAutoStart NetMeetingOrganizerAlias NetMeetingServer NetMeetingType RecurrenceState ResponseState Saved


Find Method Example

This example opens the default Calendar folder and uses the Find method to find the first appointment whose subject is "Golf w/ Jerry Wheeler."

Set myCalendar = myNameSpace.GetDefaultFolder (olFolderCalendar)

Set myItem = myCalendar.Items.Find("[Subject] = _

    ""Golf w/ Jerry Wheeler""")

This example opens the default Contacts folder and finds the first contact filed as "Jones" whose first name is "Brent."

Set myContacts = myNameSpace.GetDefaultFolder (olFolderContacts)

Set myItem = myContacts.Items.Find("[FileAs] = _

    ""Jones"" and [FirstName] = ""Brent""")

This example utilizes UserProperties and finds a custom property named "LastDateContacted" for the contact.

Set myProperty = _

    myContact.UserProperties.Find("LastDateContacted")

MsgBox "Last Date Contacted: " & myProperty.Value


FreeBusy Method

Returns free/busy information for the recipient. The default is to return a string representing one month of free/busy information compatible with the Microsoft Schedule+ Automation format (that is, the string contains one character for each MinPerChar minute, up to one month of information from the specified Start date).

If the optional argument CompleteFormat is omitted or False, then "free" is indicated by the character 0 and all other states by the character 1.

If CompleteFormat is True, then the same length string is returned as defined above, but the characters now correspond to the OlBusyStatus constants: olBusy (2), olFree (0), olOutOfOffice (3) or olTentative (1).

Syntax

objRecipient.FreeBusy(Start, MinPerChar, [CompleteFormat])

objRecipient   Required. An expression that returns a Recipient object.

Start   Required Date. The start date for the returned period of free/busy information.

MinPerChar   Required Long. The number of minutes per character represented in the returned free/busy string.

CompleteFormat   Optional Boolean. True if the returned string should contain not only free/busy information, but also values for each character according to the OlBusyStatus constants: olBusy (2), olFree (0), olOutOfOffice (3) and olTentative (1).


FreeBusy Method Example

This example uses the FreeBusy method to return a string of free/busy information with one character for each day.

Set myRecipient = myNameSpace.CreateRecipient("Paul _

    Borm")

myFBInfo = myRecipient.FreeBusy(#8/1/97#, 60 * 24)

This example returns a string of free/busy information with one character for each hour (complete format).

Set myRecipient = myNameSpace.CreateRecipient("Kevin _

    Yim")

myFBInfo = myRecipient.FreeBusy(#8/1/97#, 60, True)


GetExplorer Method

Returns an Explorer object that represents a new, inactive explorer initialized with the specified folder as the current folder. This method is useful for returning a new Explorer object in which to display the folder, as opposed to using the ActiveExplorer method and setting the CurrentFolder property.

The GetExplorer method takes an optional argument of an olFolderDisplayMode constant.

By default, the new explorer will be displayed in the Normal mode (olFolderDisplayNormal) with all interface elements displayed: a message panel on the right, an Outlook bar on the left, and a folder banner across the top from which the user can pull down a folder navigation panel.

The explorer can also be displayed in Folder Only mode (olFolderDisplayFolderOnly) in which the Explorer will display with no folder list and no Outlook bar, but the drop-down list and the navigation commands will still be available.

The mode in which shared folders always appear is olFolderDisplayNoNavigation. In this mode, the Explorer will display with no folder list, no drop-down folder list, and any “Go”-type menu/command bar/ options should be disabled. Basically, the user should not be able to navigate to any other folder within that Explorer window.

Syntax

objMAPIFolder.GetExplorer[(DisplayMode)]

objMAPIFolder   Required. An expression that returns a MAPIFolder object.

DisplayMode   Optional Long. The display mode of the folder. Can be one of the following OlFolderDisplayMode constants: olFolderDisplayFolderOnly, olFolderDisplayNoNavigation or olFolderDisplayNormal. The default value is olFolderDisplayNormal.


GetExplorer Method Example

This example uses the GetExplorer method to return a new, inactive Explorer for myFolder, and then displays it in the default mode of olFolderDisplayNormal.

Set myExplorer = myFolder.GetExplorer

myExplorer.Display


GetInspector Property

Returns an Inspector object that represents a new, inactive inspector initialized to contain the specified item. This property is useful for returning a new Inspector object in which to display the item, as opposed to using the ActiveInspector method and setting the CurrentItem property. Read-only.


GetInspector Property Example

This example uses the GetInspector property to return a new, inactive inspector for myItem, and then displays it.

Set myInspector = myItem.GetInspector

myInspector.Display


GetSharedDefaultFolder Method

Returns a MAPIFolder object that represents the specified default folder for the specified user. This method is most useful in the delegation scenario, where one user has delegated access to another user for one or more of their default folders (for example, their shared Calendar folder).

Syntax

objNameSpace.GetSharedDefaultFolder(RecipientObject, FolderTypeEnum)

objNameSpace   Required. An expression that returns a NameSpace object.

RecipientObject   Required Recipient object. The owner of the folder. The Recipient object must be resolved.

FolderTypeEnum   Required Long. The type of folder. Can be one of the following OlDefaultFolders constants: olFolderCalendar, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderInbox, olFolderJournal, olFolderNotes, olFolderOutbox, olFolderSentMail, or olFolderTasks.


GetSharedDefaultFolder Method Example

This example uses the GetSharedDefaultFolder method to resolve the Recipient object representing Kim Buhler, and then returns her shared default Contacts folder.

Set myRecipient = myNameSpace.CreateRecipient("Kim _

    Buhler")

myRecipient.Resolve

If myRecipient.Resolved Then

    Set KimContactsFolder = _

        myNameSpace.GetSharedDefaultFolder _

        (myRecipient, olFolderContacts)

End If


Hidden Property

True if the associated tabbed dialog box of the FormDescription property sheet is visible to the user. Other views of the same dialog box are not affected. The default value is False.

Read/write Boolean.

Syntax

objFormDescription.Hidden

objFormDescription    Required. An expression that returns a FormDescription object.


IncludeRecurrences Property

True if the Items collection should include recurrence patterns. This property only has an effect if the Items collection contains appointments and is not sorted by any property other than Start in ascending order. The default value is False.

Read/write Boolean.

Syntax

objItems.IncludeRecurrences

objItems    Required. An expression that returns an Items collection object.

Remarks

Use this property when you want to retrieve all appointments for a given date, where recurring appointments would not normally appear because they are not associated with any specific date. If the collection includes recurring appointments with no end date, setting the property to True may cause the collection to be of infinite count. Be sure to include a test for this in any loop.


Instance Property

Returns or sets the count for which the recurrence pattern is valid for a given interval. This property is only valid for recurrences of the olRecursMonthNth and olRecursYearNth type and allows the definition of a recurrence pattern that is only valid for the Nth occurrence, such as "the 2nd Sunday in March" pattern. The count is set numerically: 1 for the first, 2 for the second, and so on through 5 for the last. Values greater than 5 will generate errors when the pattern is saved.

Read/write Long.

Syntax

objRecurrencePattern.Instance

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


Item Method

Returns the specified Action, AddressEntry, AddressList, Attachment, Exception, MAPIFolder, Outlook Item, Page, Recipient, or UserProperty object from its respective Actions, AddressEntries, AddressLists, Attachments, Exceptions, Folders, Items, Pages, Recipients or UserProperties collection.

Syntax

object.Item(Index)

object    Required. An expression that returns an Actions, AddressEntries, AddressLists, Attachments, Exceptions, Folders, Items, Pages, Recipients or UserProperties collection object.

Index   Required Variant. Either the index number of the object, or a value used to match the default property of an object in the collection.


Item Method Example

This example returns the second MailItem object in the default Inbox folder. It assumes that at least two MailItem objects already exist.

Set myFolder = _

    myNameSpace.GetDefaultFolder(olFolderInbox)

Set mySecondItem = myFolder.Items.Item(2)

This example returns the "Forward" action from the Actions collection.

Set myItem = myOlApp.ActiveInspector.CurrentItem

Set myAction = myItem.Actions.Item("Forward")

This example returns a MAPIFolder object from a Folders collection.

Set myFolders = myNameSpace.Folders

Set myFolder = myFolders.Item("Public Folder")

This example also returns a MAPIFolder object from a Folders collection.

Set myFolders = _

    myOlApp.ActiveExplorer.CurrentFolder.Folders

Set myFolder = myFolders.Item("Project X")

This example creates a contact, returns its empty Pages collection, adds three custom pages and then returns the first custom page from the collection.

Set myItem = myOlApp.CreateItem(olContactItem)

Set myPages = myItem.GetInspector.ModifiedFormPages

myPages.Add "One"

myPages.Add "Two"

myPages.Add "Three"

Set myPage = myPages.Item("One")

This example creates a mail message, adds four Recipient objects, then returns the third recipient from the newly-created Recipients collection and sets it as a BCC recipient.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipients = myItem.Recipients

myRecipients.Add("Rich Andrews")

myRecipients.Add("Robin Hjellin")

myRecipients.Add("Meng Phua")

myRecipients.Add("Kim Yoshida")

myRecipients.Item(3) = olBCC

This example returns the "Total Cost" user property from the "My Order Form" UserProperties collection.

Set myItems = myOlApp.ActiveExplorer.CurrentItem.Items

Set myItem = myItems.Add("My Order Form")

Set myProperties = myItem.UserProperties

Set myProperty = myProperties.Item("Total Cost")


Regenerate Property

True if the task should be regenerated following this pass through the recurrence pattern. This property is used to control the regeneration of the task as each occurrence of a recurring task is completed.

Read/write Boolean.

Syntax

obRecurrencePattern.Regenerate

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


Regenerate Property Example

This example creates a task called "Oil Change" that recurs every three months and sets it to regenerate after each recurrence.

Set myItem = myOlApp.CreateItem(olTaskItem)

Set myPattern = myItem.GetRecurrencePattern

myPattern.RecurrenceType = olRecursMonthly

myPattern.Regenerate = True

myPattern.Interval = 3

myItem.Subject = "Oil Change"

myItem.Save

myItem.Display


Respond Method

Responds to a meeting request for the AppointmentItem object or a task request for the TaskItem object.

Syntax

object.Respond(IResponse, [fNoUI], [fAdditionalTextDialog])

object   Required. An expression that returns an AppointmentItem or TaskItem object.

IResponse   Required Long. The response to the request. Can be one of the following OlResponseStatus constants: olResponseAccepted, olResponseDeclined, olResponseNone, olResponseNotResponded, olResponseOrganized, or olResponseTentative.

fNoUI   Optional Boolean. True to not display a dialog box; the response is sent automatically. False to display the dialog box for responding.

fAdditionalTextDialog   Optional Boolean. True to not prompt the user for input; the response is displayed in the inspector for editing. False to prompt the user to either send or send with comments. This argument is valid only if fNoUI is False.


Respond Method Example

This example gets the appointment from the meeting request, accepts the meeting request and brings up the Inspector containing the response to allow entry of additional text before sending it.

set myAppt = myMtgReq.GetAssociatedAppointment(True)

myAppt.Respond olResponseAccepted, False, True


Restrict Method

Applies a filter to the Items collection, returning a new collection containing all items from the original which match the filter. This method is an alternative to using the Find method or FindNext method to iterate over specific items within a collection. Find or FindNext is faster than filtering if there are a small number of items. Restrict is useful where performance is not a concern.

Syntax

objItems.Restrict(Filter)

objItems    Required. An expression that returns an Items collection object.

Filter   Required String. A filter string expression to be applied. For details, see the Find method.

Remarks

This property cannot be used, and will cause an error, with the following properties:

ConversationIndex Email1EntryID Email2EntryID Email3EntryID EntryID ReceivedByEntryID	ReceivedOnBehalfOfEntryID ResponseState Saved Unread UserCertificate VotingOptions
Remarks

For the Items collection, Restrict cannot be used, and will cause an error, with the following properties:

Categories Children Class Companies CompanyLastFirstNoSpace CompanyLastFirstSpaceOnly Contacts IsOnlineMeeting LastFirstAndSuffix LastFirstNoSpace	LastFirstNoSpaceCompany LastFirstSpaceOnly LastFirstSpaceOnlyCompany NetMeetingAlias NetMeetingAutoStart NetMeetingOrganizerAlias NetMeetingServer NetMeetingType RecurrenceState ResponseState Saved


Sort Method

Sorts the collection of items by the specified property. The index for the collection is reset to 1 upon completion of this method.

Syntax

object.Sort(Property, [Descending])

object   Required. An expression that returns an Items collection object.

Property   Required String. The name of the property by which to sort, enclosed in brackets (for example, “[CompanyName]”). May not be a multi-valued property, such as a category.

Descending   Optional Boolean. True to sort in descending order. The default value is False (ascending).

Remarks

For the Items collection, Sort cannot be used, and will cause an error, with the following properties:

Categories Children Class Companies CompanyLastFirstNoSpace CompanyLastFirstSpaceOnly Contacts IsOnlineMeeting LastFirstAndSuffix LastFirstNoSpace	LastFirstNoSpaceCompany LastFirstSpaceOnly LastFirstSpaceOnlyCompany NetMeetingAlias NetMeetingAutoStart NetMeetingOrganizerAlias NetMeetingServer NetMeetingType RecurrenceState ResponseState Saved


Sort Method Example

The following example uses the Sort method to sort the Items collection for the default Contacts folder by the "CompanyName" property and then displays the sorted items, each in turn.

set myFolder = _

    myNameSpace.GetDefaultFolder(olFolderContact)

myFolder.Items.Sort "[CompanyName]", False

For Each myItem in myFolder.Items

    myItem.Display

Next myItem


Add Method (AddressEntries)

Creates a new address entry in the AddressEntries collection, and returns the new address as an AddressEntry object.

Syntax

objAddressEntries.Add(Type, [Name], [Address])

objAddressEntries    Required. An expression that returns an AddressEntries collection object.

Type          Required. String. The type of the address entry.

Name        Optional. String. Display name for the address entry.

Address    Optional. String. The e-mail address of the address entry.


Details Method

The Details method displays a modal dialog box that provides detailed information about an AddressEntry object. You must use error handling to handle run time errors when the user hits the cancel button in the dialog box. The Details method actually stops the code from running while the dialog box is displayed.

Note  The Details method fails if either the FullName or Address property is empty.

Syntax

objAddressEntry.Details([HWnd])

objAddressEntry  Required. An AddressEntry object.

HWnd   Optional. Long. The parent window handle for the details dialog box. A zero value (the default) specifies a modal dialog box.


GetFirst Method

The GetFirst method returns the first object in the collection. Returns Nothing if no first object exists, for example, if there are no objects in the collection.

Note: To ensure correct operation of theGetFirst, GetLast, GetNext, and GetPrevious methods in a large collection, call GetFirst before calling GetNext on that collection, and call GetLast before calling GetPrevious. To ensure that you are always making the calls on the same collection, create an explicit variable that refers to that collection before entering the loop.

Syntax

Set object. objCollection.GetFirst()

object  Required. On successful return, represents the first object in the collection.

objCollection  Required. The collection object.


GetFreeBusy Method

The GetFreeBusy method returns a string representing the availability of the individual user for a period of 30 days from the start date, beginning at midnight of the date specified.

Note: If an address entry represents a distribution list, the status of its individual members cannot be returned to you with the GetFreeBusy method. A meeting request should be sent only to single messaging users. You can determine if a messaging user is a distribution list by determining if its DisplayType property is olDistList or olPrivateDistList.

Syntax

strAvail = objAddressEntry.GetFreeBusy(StartDate, Interval, [CompleteFormat])

strAvail   Required String. On successful return, contains a string indicating the user’s availability.

objAddressEntry   Required. The AddressEntry object.

StartDate    Required. vbDate. Specifies the date.

Interval   Required. Long. Specifies the length of each time slot in minutes. Default is 30 minutes.

CompleteFormat   Optional. OlBusyStatus constant.


GetLast Method

The GetLast method returns the last object in the collection. It returns Nothing if no last object exists, for example, if the collection is empty.

Note: To ensure correct operation of the GetFirst, GetLast, GetNext, and GetPrevious methods in a large collection, call GetFirst before calling GetNext on that collection, and call GetLast before calling GetPrevious. To ensure that you are always making the calls on the same collection, create an explicit variable that refers to that collection before entering the loop.

Syntax

Set object = objCollection.GetLast()

object    Required. On successful return, represents the last object in the collection.

objCollection    Required. The collection object.


GetNext Method

The GetNext method returns the next object in the collection. It returns Nothing if no next object exists, for example, if already positioned at the end of the collection.

Note: To ensure correct operation of the GetFirst, GetLast, GetNext, and GetPrevious methods in a large collection, call GetFirst before calling GetNext on that collection, and call GetLast before calling GetPrevious. To ensure that you are always making the calls on the same collection, create an explicit variable that refers to that collection before entering the loop.

Syntax

Set object = objCollection.GetNext()

object    Required. On successful return, represents the next object in the collection.

objCollection   Required. The collection object.


GetOccurrence Method

The GetOccurrence method returns a specific instance of the AppointmentItem object on the specified date. Returns Nothing if no appointment of that series exists on the specified date.

Syntax

Set objAppointmentItem = objRecurrencePattern.GetOccurrence(Date/Time)

objAppointmentItem   Required. An AppointmentItem object.

objRecurrencePattern   Required. A RecurrencePattern object.

Date/Time   Required. A vbDate variant data type that represents local time.


GetPrevious Method

The GetPrevious method returns the previous object in the collection. It returns Nothing if no previous object exists, for example, if already positioned at the beginning of the collection.

Note: To ensure correct operation of the GetFirst, GetLast, GetNext, and GetPrevious methods in a large collection, call GetFirst before calling GetNext on that collection, and call GetLast before calling GetPrevious. To ensure that you are always making the calls on the same collection, create an explicit variable that refers to that collection before entering the loop.

Syntax

Set object = objCollection.GetPrevious()

object   Required. On successful return, represents the previous object in the collection.

objCollection   Required. The collection object.


IsHTMLMail Method

The IsHTMLMail method returns a Boolean value that determines whether the Inspector is displaying an HTML Mail message. Returns True if the Inspector is viewing an HTML Mail message.

Syntax

objInspector.IsHTMLMail

objInspector  Required. An expression that returns an Inspector object.


PickFolder Method

The PickFolder method displays the Pick Folder dialog box. This is a modal dialog box which means that code execution will not continue until the user either selects a folder or cancels the dialog box. Returns a MAPIFolder object corresponding to the folder that the user selects in the dialog box. Returns Nothing when the dialog box is canceled by the user.

Syntax

objNameSpace.PickFolder

objNameSpace  Required. A NameSpace object.


ResetColumns Method

The ResetColumns method clears the properties that have been cached with the SetColumns method. All properties are accessible after calling the ResetColumns method. SetColumns should be reused to store new properties again. ResetColumns does nothing if SetColumns has not been called first.

Syntax

objItems.ResetColumns()

objItems  Required. An Items collection object.


SetColumns Method

The SetColumns method allows the user to cache certain properties for blindingly fast access to those particular properties of the item. The SetColumns method is useful for iterating through the Items collection. If you don’t use this method, Outlook must open each item to access the property. With the SetColumns method, Outlook only checks the properties that you have cached. Properties which are not cached are returned empty.

Syntax

objItems.SetColumns(Columns)

objItems   Required. An Items collection object.

Columns   Required. A String.

Remarks

For the Items collection, SetColumns cannot be used, and will cause an error, with the following properties:

Categories Children Class Companies CompanyLastFirstNoSpace CompanyLastFirstSpaceOnly Contacts IsOnlineMeeting LastFirstAndSuffix LastFirstNoSpace	LastFirstNoSpaceCompany LastFirstSpaceOnly LastFirstSpaceOnlyCompany NetMeetingAlias NetMeetingAutoStart NetMeetingOrganizerAlias NetMeetingServer NetMeetingType RecurrenceState ResponseState Saved


Update Method

The Update method posts a change to the AddressEntry object in the messaging system.

New entries or changes to existing entries are not persisted in the collection until the Update method has been called with its makePermanent parameter set to True.

To flush the cache and then reload the values from the address book, call Update with the makePermanent parameter set to False and the refreshObject parameter set to True.

Syntax

objAddressEntry.Update([makePermanent], [refreshObject])

objAddressEntry   Required. The AddressEntry object.

makePermanent   Optional. Boolean. A value of True indicates that the property cache is flushed and all changes are committed in the underlying address book. A value of False indicates that the property cache is flushed but not committed to persistent storage. The default value is True.

refreshObject   Optional. Boolean. A value of True indicates that the property cache is reloaded from the values in the underlying address book. A value of False indicates that the property cache is not reloaded. The default value is False.


UpdateFreeBusy Method

Syntax

objAddressEntry.UpdateFreeBusy()

objAddressEntry   Required. An AddressEntry object.


AddressEntries Collection Object

The AddressEntries collection object is a collection of addresses in an AddressList object. The collection may contain zero or more AddressEntry objects and provides access to the entries in a transport provider’s address book container.

Using the AddressEntries Collection Object

Set abes = abl.AddressEntries

You can also index directly into the AddressEntries collection, returning an AddressEntry object.

Set abe = abl.AddressEntries(index)


AddressEntry Object

The AddressEntry  object is an address in an AddressEntries collection object. Each AddressEntry object in the collection holds information that represents a person or process to which the messaging system can deliver messages.

Using the AddressEntry Object

Set abe = rcp.AddressEntry

Use AddressEntries(index), where index is the index number of an address entry or a value used to match the default property of an address entry, to return a single AddressEntry object.

Set abe = abes.Item(index)


AddressList Object

The AddressList object is an address book that contains a set of AddressEntry objects. For instance, the Personal Address List is an AddressList object.

The AddressList object supplies a list of address entries to which a messaging system can deliver messages. An AddressList object represents one address book container available under the transport provider’s address book hierarchy for the current session. The entire hierarchy is available through the parent AddressLists collection.

Using the AddressList Object

Set abl = Application.Session.AddressLists(“Personal Address Book”)


AddressLists Collection Object

The AddressLists collection contains a set of AddressList objects. The AddressLists collection provides access to the root of the transport provider’s address book hierarchy for the current session.

Using the AddressLists Collection Object

Set abls = nsp.AddressLists


DocumentItem Object

A DocumentItem object is any document other than an Outlook item as an item in an Outlook folder. In common usage, this will be an Office document but may be any type of document or executable file.


Exception Object

The Exception object holds information about one instance of an AppointmentItem object which is an exception to a recurring series. Unlike most of the other Outlook objects, the Exception object is a read-only object. This means that you cannot create an Exception object but, rather, the object is created when a property of an AppointmentItem is altered.

The Exception object can be accessed from the RecurrencePattern object through the Exceptions collection.

Using the Exception Object

Set exx = rcr.Exceptions.Item(index)


Exceptions Collection Object

The Exceptions collection object is a group of Exception objects. If you have a recurring AppointmentItem, the RecurrencePattern object defines the recurrence of these appointments. The Exceptions collection contains the group of Exception objects that define the exceptions to the appointments.

Using the Exceptions Collection Object

Set exxs = rcr.Exceptions


TaskRequestAcceptItem Object

Represents an item in an Inbox (mail) folder.

A TaskRequestAcceptItem object represents a response to a TaskRequestItem sent by the initiating user. If the delegated user accepts the task, the OlTaskResponse constant in the ResponseState property is set to olTaskAccept. The associated TaskItem is received by the delegator as a TaskRequestAcceptItem object.

Using the TaskRequestAcceptItem Object

Unlike other Outlook objects, you cannot create this object.

Use the GetAssociatedTask method to return the TaskItem object that is associated with this TaskRequestAcceptItem. Work directly with the TaskItem object.


TaskRequestDeclineItem Object

Represents an item in an Inbox (mail) folder.

A TaskRequestDeclineItem object represents a response to a TaskRequestItem sent by the initiating user. If the delegated user declines the task, the OlTaskResponse constant in the ResponseState property is set to olTaskDecline. The associated TaskItem is received by the delegator as a TaskRequestDeclineItem object.

Using the TaskRequestDeclineItem Object

Unlike other Outlook objects, you cannot create this object.

Use the GetAssociatedTask method to return the TaskItem object that is associated with this TaskRequestDeclineItem. Work directly with the TaskItem object.


TaskRequestUpdateItem Object

Represents an item in an Inbox (mail) folder.

A TaskRequestUpdateItem object represents a response to a TaskRequestItem sent by the initiating user. If the delegated user updates the task by changing properties such as the DueDate or the Status, the OlTaskResponse constant in the ResponseState property is set to olTaskUpdate. The associated TaskItem is received by the delegator as a TaskRequestUpdateItem object.

Using the TaskRequestUpdateItem Object

Unlike other Outlook objects, you cannot create this object.

Use the GetAssociatedTask method to return the TaskItem object that is associated with this TaskRequestUpdateItem. Work directly with the TaskItem object.


AddressEntries Property

Returns the AddressEntries collection for this object.

Read-only.

Syntax

objAddressList.AddressEntries

objAddressList   Required. An expression that returns an AddressList object.


AddressEntry Property

Returns the AddressEntry object corresponding to the resolved recipient. Accessing the AddressEntry property forces resolution of an unresolved recipient name. If the name cannot be resolved, an error is returned. If the recipient is resolved, the Resolved property is True.

Read-only.

Syntax

objRecipient.AddressEntry

objRecipient  Required. An expression that returns a Recipient object.


AddressLists Property

Returns a collection of the address lists available for this session. The AddressLists collection represents the root of the address book hierarchy for the current session. A particular AddressList object represents one of the available address books. The type of access you obtain depends on the access permissions granted to you by each individual address book provider.

Read-only.

Syntax

Set objAddressLists = objNameSpace.AddressLists

objAddressLists  Required. An expression that returns an AddressLists collection object.

objNameSpace   Required. An expression that returns a NameSpace object.


AppointmentItem Property

Returns the AppointmentItem object that is the exception. Not valid for deleted appointments.

Read-only.

Syntax

Set objAppointmentItem = objException.AppointmentItem

objAppointmentItem   Required. An expression that returns an AppointmentItem object.

ObjException   Required. An expression that returns an Exception object.


Class Property

Returns the OlObjectClass constant for this object:

olAction, olActions, olAddressEntries, olAddressEntry, olAddressList, olAddressLists, olApplication, olAppointment, olAttachment, olAttachments, olContact, olDocument, olException, olExceptions, olExplorer, olFolder, olFolders, olFormDescription, olInspector, olItems, olJournal, olMail, olMeetingCancellation, olMeetingRequest, olMeetingResponseNegative, olMeetingResponsePositive, olMeetingResponseTentative, olNamespace, olNote, olPages, olPost, olRecipient, olRecipients, olRecurrencePattern, olRemote, olReport, olTask, olTaskRequest, olTaskRequestAccept, olTaskRequestDecline, olTaskRequestUpdate, olUserProperties, olUserProperty for this object. This is a numeric constant that identifies the object’s class.

Read-only.

Syntax

object.Class

object   Required. An expression that returns an Outlook object.


CompanyLastFirstNoSpace Property

Returns the company name for the contact followed by the concatenated last name, first name, and middle name with no space between the last and first names. This property is parsed from the CompanyName, LastName, FirstName and MiddleName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.CompanyLastFirstNoSpace

objContactItem   Required. An expression that returns a ContactItem object.


CompanyLastFirstSpaceOnly Property

Returns the company name for the contact followed by the concatenated last name, first name, and middle name with spaces between the last, first, and middle names. This property is parsed from the CompanyName, LastName, FirstName and MiddleName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.CompanyLastFirstSpaceOnly

objContactItem   Required. An expression that returns a ContactItem object.


Deleted Property

Indicates that the appointment became an exception because it was deleted from the recurring pattern. The Deleted property is True if the AppointmentItem was deleted.

Read-only Boolean.

Syntax

objException.Deleted

objException   Required. An expression that returns an Exception object.


DeliveryReceipt Property

True if a delivery receipt is required by the originator. Each transport provider that handles your message sends you a single delivery notification containing the names and addresses of all recipients to whom it was delivered. Note that delivery does not imply that the message has been read. The DeliveryReceipt property corresponds to the MAPI property PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED.

Read-only Boolean.

Syntax

objMeetingItem.DeliveryReceipt

objMeetingItem   Required. An expression that returns a MeetingItem object.


DisplayType Property

Returns the OlDisplayType constant(olAgent, olDistList, olForum, olOrganization, olPrivateDistList, olRemoteUser, olUser) that describes the nature of the recipient. You can use the DisplayType property to filter recipients. The DisplayType property corresponds to the MAPI property PR_DISPLAY_TYPE.

Read-only.

Syntax

object.DisplayType

object   Required. An expression that returns an AddressEntry or  Recipient object.


Exceptions Property

Returns the Exceptions collection for that particular series.

Read-only.

Syntax

objRecurrencePattern.Exceptions

objRecurrencePattern   Required. An expression that returns a RecurrencePattern object.


HTMLEditor Property

Returns the HTML Document Object Model of the message being displayed. The HTML Document Object Model is the one defined by Internet Explorer 4.0 and is the same one used for Dynamic HTML. This object may be temporary and should not be stored for later use. The HTMLEditor property is only valid if IsHTMLMail returns True.

Read-only.

Syntax

objInspector.HTMLEditor

objInspector   Required. An expression that returns an Inspector object.


HTMLEditor Property Example

The following VBScript example demonstrates the listing of all HTML elements.

Sub CommandButton1_Click()

Dim isp 	'As Inspector

Dim tri 	'As HTMLDocument

Dim i 	'As Integer

Dim strHTMLType	'As String

Dim strHTMLText	'As String

Dim NL	'As String

NL = chr(10) & chr(13)

Set isp = item.GetInspector

Set tri = isp.HTMLEditor

For i = 0 To tri.all.Length - 1

strHTMLType = TypeName(tri.all.Item(i))

on error resume next	'because not all elements support outerHTML

strHTMLText = ": " & NL & tri.all.Item(i).outerHTML

on error goto 0

msgbox strHTMLType & strHTMLText

strHTMLText = ""

Next

End Sub


ID Property

Returns the unique ID for the object. The transport provider assigns a permanent, unique string ID property when an individual member object is created. These identifiers do not change from one session to another.

Read-only String.

Syntax

object.ID

object    Required. An expression that returns an AddressEntry or AddressList object.


Index Property

Returns the position of the object within the collection. The Index property is only valid during the current session and can change as objects are added to and deleted from the collection. The first object in the collection has an Index value of 1.

Read-only Long.

Syntax

object.Index

object   Required. An expression that returns an AddressList, Attachment, or Recipient object.


InternetFreeBusyAddress Property

The InternetFreeBusyAddress property refers to the reading and publishing of a calendar user’s free/busy map of events. The map is retrieved when a user plans a meeting. This property corresponds to a field in the details page for an Internet Only contact. This field can contain the URL location of the user’s free/busy map.

Read/write String.

Syntax

objContactItem.InternetFreeBusyAddress

objContactItem   Required. An expression that returns a ContactItem object.

Note This property is only applicable for Internet Only support users.


IsOnlineMeeting Property

This property corresponds to the This is an online meeting checkbox on the Appointment page and to the corresponding This is an online meeting using checkbox on the Online page of a meeting item. True if this is an online meeting.

Boolean.

Syntax

objAppointmentItem.IsOnlineMeeting

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


IsReadOnly Property

Indicates that the AddressList object cannot be modified. The IsReadOnly property refers to adding and deleting the entries in the address book container represented by the AddressList object. The property is True if no entries can be added or deleted. The property is False if the container can be modified, that is, if address entries can be added to and deleted from the container.

IsReadOnly refers to the address book entries in the context of the address book container. It does not indicate whether the contents of the individual entries themselves can be modified.

Read-only Boolean.

Syntax

objAddressList.IsReadOnly

objAddressList   Required. An expression that returns an AddressList object.


Manager Property

Returns an AddressEntry object that represents the manager of the user that corresponds to this address entry. If the user’s manager is not available in the messaging system, the Manager property returns Nothing.

Read-only.

Syntax

objAddressEntry.Manager

objAddressEntry   Required. An expression that returns an AddressEntry object.


Members Property

Returns an AddressEntries collection if the AddressEntry is a distribution list. The AddressEntry is a distribution list if its DisplayType is set to olDistList or olPrivateDistList. The Members property returns Nothing if the AddressEntry is not a distribution list.

Read-only.

Syntax

objAddressEntry.Members

objAddressEntry   Required. An expression that returns an AddressEntry object.


LastFirstAndSuffix Property

Returns the last name, first name, middle name, and suffix of the contact. There is a comma between the last and first names and spaces between all the names and the suffix. This property is parsed from the LastName, FirstName, MiddleName and Suffix properties.

Read-only String.

Note: The LastName, FirstName, MiddleName, and Suffix properties are themselves parsed from the FullName property.

Syntax

objContactItem.LastFirstAndSuffix

objContactItem   Required. An expression that returns a ContactItem object.


LastFirstNoSpace Property

Returns the concatenated last name, first name, and middle name of the contact with no space between the last name and the first name. This property is parsed from the LastName, FirstName and MiddleName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.LastFirstNoSpace

objContactItem   Required. An expression that returns a ContactItem object.


LastFirstNoSpaceCompany Property

Returns the concatenated last name, first name, and middle name of the contact with no space between the last name and the first name. The company name for the contact is included after the middle name. This property is parsed from the LastName, FirstName, MiddleName, and CompanyName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.LastFirstNoSpaceCompany

objContactItem   Required. An expression that returns a ContactItem object.


LastFirstSpaceOnly Property

Returns the concatenated last name, first name, and middle name of the contact with spaces between them. This property is parsed from the LastName, FirstName and MiddleName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.LastFirstSpaceOnly

objContactItem   Required. An expression that returns a ContactItem object.


LastFirstSpaceOnlyCompany Property

Returns the concatenated last name, first name, and middle name of the contact with spaces between them. The company name for the contact after the middle name. This property is parsed from the LastName, FirstName and MiddleName properties.

Read-only String.

Note: The LastName, FirstName, and MiddleName properties are themselves parsed from the FullName property.

Syntax

objContactItem.LastFirstSpaceOnlyCompany

objContactItem   Required. An expression that returns a ContactItem object.


NetMeetingAlias Property

Read/write String.

Syntax

objContactItem.NetMeetingAlias

objContactItem   Required. An expression that returns a ContactItem object.


NetMeetingAutoStart Property

This property corresponds to the checkbox on the Online page of an online meeting item that is labeled Automatically start NetMeeting 15 minutes. True is this online meeting starts automatically.

Read/write Boolean.

Syntax

objAppointmentItem.NetMeetingAutoStart

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


NetMeetingOrganizerAlias Property

This property corresponds to the Organizer’s e-mail address field on the Online page of an online meeting item.

Read/write String.

Syntax

objAppointmentItem.NetMeetingOrganizerAlias

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


NetMeetingServer Property

This property corresponds to the Directory Server field on the Online page of an online meeting item.

Read/write String.

Syntax

object.NetMeetingServer

object   Required. An expression that returns an AppointmentItem or ContactItem object.


NetMeetingType Property

This property corresponds to the NetMeeting type drop-down list box on the Online page of an online meeting item. Can be one of the OlNetMeetingType constants: olChat, olNetMeeting, or olNetShow. Currently, the only NetMeetingType that Outlook supports is olNetMeeting.

Read/write String.

Syntax

objAppointmentItem.NetMeetingType

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


OriginalDate Property

Returns the original date and time of the AppointmentItem before it was altered. This property will return the original date even if the AppointmentItem has been deleted but it will not return the original time if deletion has occurred.

Read-only as Date/Time.

Syntax

objException.OriginalDate

objException   Required. An expression that returns an Exception object.


RecurrenceState Property

Returns the recurrence property of the object. Can be one of the following OlRecurrenceState constants: olApptException, olApptMaster, olApptNotRecurring, olApptOccurrence.

Read-only.

Syntax

objAppointmentItem.RecurrenceState

obAppointmentItem   Required. An expression that returns an AppointmentItem object.


ScriptText Property

Returns a string containing all the VBScript in the form.

Read-only String.

Syntax

objFormDescription.ScriptText

objFormDescritipn   Required. An expression that returns a FormDescription object.


Sender Property

Returns a string containing the full display name of the sender of a meeting item.

Read-only String.

Syntax

objMeetingItem.Sender

objMeetingItem   Required. An expression that returns a MeetingItem object.


Sent Property

Returns a Boolean value that indicates if a message has been sent. True if sent, False if not sent.

In general, there are three different kinds of messages: sent, posted, and saved. Sent messages are traditional e-mail messages or meeting items sent to a recipient or public folder. Posted messages are created in a public folder. Saved messages are created and saved without either sending or posting.

Read-only Boolean.

Syntax

object.Sent

object   Required. An expression that returns a MeetingItem or MailItem object.


Session Property

Returns the NameSpace object for the current session.

Read-only.

Syntax

object.Session

object   Required. An expression that returns the object to which the Session property is being applied.


Submitted Property

Returns a Boolean value that indicates if the item has been submitted. True if the item has been submitted. A message is always created and submitted in a folder, usually the Outbox.

Read-only Boolean.

Syntax

object.Submitted

object   Required. An expression that returns a MeetingItem or MailItem object.


TimeExpired Property

Returns the time that the meeting item expires as a vbDate variant data type that represents local time. (11/9/1997 2:30:44 PM)

Read-only Date/Time.

Syntax

objMeetingItem.TimeExpired

objMeetingItem   Required. An expression that returns a MeetingItem object.


TimeReceived Property

Returns the time that the meeting item was received as a vbDate variant data type that represents local time. (11/9/1997 2:30:44 PM)

The TimeReceived property corresponds to the MAPI property PR_MESSAGE_DELIVERY_TIME. When you send a meeting request item using the object’s Send method, the transport provider sets the TimeReceived and TimeSent properties for you.

Read-only Date/Time.

Syntax

objMeetingItem.TimeReceived

objMeetingItem   Required. An expression that returns a MeetingItem object.


TimeSent Property

Returns the time that the meeting item was sent as a vbDate variant data type that represents local time. (11/9/1997 2:30:44 PM)

The TimeSent property corresponds to the MAPI property PR_MESSAGE_DELIVERY_TIME. When you send a meeting request item using the object’s Send method, the transport provider sets the TimeReceived and TimeSent properties for you.

Read-only Date/Time.

Syntax

objMeetingItem.TimeSent

objMeetingItem   Required. An expression that returns a MeetingItem object.


WordEditor Property

Returns the Word Document Object Model of the message being displayed. This object model may be temporary and should not be stored for later use. The WordEditor property is only valid if IsWordMail returns True.

Read-only.

Syntax

objInspector.WordEditor

objInspector    Required. An expression that returns an Inspector object.


WordEditor Property Example

The following VBScript example demonstrates the use of Word’s object model.

Sub CommandButton1_Click()

    Dim isp    'As Inspector

    Dim wrd    'As Word.Document

    Dim fil    'As Word.FillFormat

    Set isp = item.GetInspector

    Set wrd = isp.WordEditor

    Set fil = wrd.Shapes.AddShape(1, 90, 90, 90, 50).Fill	'msoShapeRectangle=1

    fil.ForeColor.RGB = RGB(128, 0, 0)

    fil.BackColor.RGB = RGB(170, 170, 170)

    fil.TwoColorGradient 4, 1	'msoGradientDiagonalDown=4

End Sub


Account Property

Returns or sets the account for the contact.

Read/write String.

Syntax

objContactItem.Account

objContactItem   Required. An expression that returns a ContactItem object.


ActiveExplorer Method

Returns the topmost Explorer object on the desktop. If no explorer is active, returns Nothing. Use this method to return the Explorer object that the user is most likely viewing. This method is also useful for determining when there is no active explorer, so a new one can be opened.

Syntax

objApplication.ActiveExplorer

objApplication    Required. An expression that returns an Application object.


ActiveExplorer Method Example

This example uses ActiveExplorer to demonstrate how to obtain an Explorer object for use, preferably getting the user’s active explorer, but creating a new one for myFolder if there isn’t already one on the desktop.

Set myExplorer = myOlApp.ActiveExplorer

If TypeName(myExplorer) = "Nothing" Then

    Set myExplorer = myFolder.GetExplorer

End If


ActiveInspector Method

Returns the topmost Inspector object on the desktop. If no inspector is active, returns Nothing. Use this method to access the Inspector object that the user is most likely to be viewing.

Syntax

objApplication.ActiveInspector

objApplication   Required. An expression that returns an Application object


ActiveInspector Method Example

This example uses the ActiveInspector method to demonstrate how to obtain the currently active Inspector object and display the name of the item that the inspector is displaying.

Set myInspector = myOlApp.ActiveInspector

MsgBox "The active item is " & myInspector.CurrentItem.Subject


ActualWork Property

Returns or sets the actual effort (in minutes) spent on the task.

Read/write Long.

Syntax

objTaskItem.ActualWork

objTaskItem   Required. An expression that returns a TaskItem object.


Add Method (Folders Object)

Creates a new folder in the Folders collection, and returns the new folder as a MAPIFolder object.

Syntax

objFolders.Add(Name, [Type])

objFolders   Required. An expression that returns a Folders object.

Name   Required String. The display name for the new folder.

Type   Optional Long. The Outlook folder type for the new folder. Can be one of the following OlDefaultFolders constants: olFolderCalendar, olFolderContacts, olFolderDrafts, olFolderInbox, olFolderJournal, olFolderNotes, or olFolderTasks. (The constants olFolderDeletedItems, olFolderOutbox, and olFolderSentMail cannot be specified for this argument.)


Add Method (Folders Collection) Example

This example uses the Add method to add the new folder named "My Contacts" to the current (default) Contacts folder.

Set myFolder = myNamespace.GetDefaultFolder(olFolderContacts)

Set myNewFolder = myFolder.Folders.Add("My Contacts")


Add Method (Recipients Object)

Creates a new recipient in the Recipients collection, and returns the new recipient as a Recipient object.

Syntax

objRecipients.Add(Name)

objRecipients   Required. An expression that returns a Recipients collection object.

Name   Required String. The display name of the recipient.


Add Method (Recipients Collection) Example

This example creates a new mail message, uses the Add method to add "Allison Klein" as a To recipient, and displays the message.

Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add("Allison Klein")

myItem.Display

This is the same example, but the recipient is changed from the default (To) to carbon copy (CC).

Set myRecipient= myItem.Recipients.Add("Allison Klein")

myRecipient.Type = olCC


Add Method (Actions Object)

Creates a new action in the Actions collection, and returns the new action as an Action object.

Syntax

objActions.Add

objActions   Required. An expression that returns an Actions collection object.


Add Method (Actions Object) Example

This example creates a new mail message and uses the Add method to add an Action to it.

Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAction = myItem.Actions.Add


Address Property

Returns or sets the e-mail address of the recipient.

Read/write String.

Syntax

objRecipient.Address

objRecipient   Required. An expression that returns a Recipient object.


AllDayEvent Property

True if the appointment is an all-day event (as opposed to a specified time).

Read/write Boolean.

Syntax

objAppointmentItem.AllDayEvent

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


AlternateRecipientAllowed Property

True if the mail message can be forwarded.

Read/write Boolean.

Syntax

objMailItem.AlternateRecipientAllowed

objMailItem   Required. An expression that returns a MailItem object.


Anniversary Property

Returns or sets the anniversary date for the contact.

Read/write Date.

Syntax

objContactItem.Anniversary

objContactItem   Required. An expression that returns a ContactItem object.


Application Property

Returns an Application object that represents the parent application (Microsoft Outlook) for the item.

Read-only.

Syntax

object.Application

object   Required. An expression that returns an Outlook object.


Assistant Property

Returns an Assistant object that represents the Microsoft Office Assistant.

Read-only.


AssistantName Property

Returns or sets the name of the person who is the assistant for the contact.

Read/write String.

Syntax

objContactItem.AssistantName

objContactItem   Required. An expression that returns a ContactItem object.


AssistantTelephoneNumber Property

Returns or sets the telephone number of the person who is the assistant for the contact.

Read/write String.

Syntax

objContactItem.AssistantTelephoneNumber

objContactItem   Required. An expression that returns a ContactItem object.


Attachments Property

Returns an Attachments object that represents all the attachments for the item.

Read-only.

Syntax

object.Attachments

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


AutoResponse Property

Returns or sets the text of an automatic response for the Recipient.

Read/write String.

Syntax

objRecipient.AutoResponse

objRecipient   Required. An expression that returns a Recipient object.


BCC Property

Returns the display list of blind carbon copy (BCC) names for the Recipient. This property contains the display names only. The Recipients collection should be used to modify the BCC recipients.

Read-only String.

Syntax

objMailItem.BCC

objMailItem   Required. An expression that returns a MailItem object.


BillingInformation Property

Returns or sets the billing information associated with the Outlook item. This is a free-form text field.

Read/write String.

Syntax

object.BillingInformation

object  Required. An expression that returns an Outlook object.


Birthday Property

Returns or sets the birthday for the contact.

Read/write Date.

Syntax

objContactItem.Birthday

objContactItem  Required. An expression that returns a ContactItem object.


Body Property

Returns or sets the clear-text body of the mail message or post.

Read/write String.

Syntax

object.Body

object  Required. An expression that returns an Outlook object.


Business2TelephoneNumber Property

Returns or sets the second business telephone number for the contact.

Read/write String.

Syntax

objContactItem.Business2TelephoneNumber

objContactItem  Required. An expression that returns a ContactItem object.


BusinessAddress Property

Returns or sets the whole, unparsed business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddress

objContactItem  Required. An expression that returns a ContactItem object.


BusinessAddressCity Property

Returns or sets the city name portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressCity

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessAddressCountry Property

Returns or sets the country code portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressCountry

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessAddressPostalCode Property

Returns or sets the postal code (zip code) portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressPostalCode

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessAddressPostOfficeBox Property

Returns or sets the post office box number portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressPostOfficeBox

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessAddressState Property

Returns or sets the state code portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressState

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessAddressStreet Property

Returns or sets the street address portion of the business address for the contact.

Read/write String.

Syntax

objContactItem.BusinessAddressStreet

objContactItem  Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the BusinessAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to the BusinessAddress property.


BusinessFaxNumber Property

Returns or sets the business fax number for the contact.

Read/write String.

Syntax

objContactItem.BusinessFaxNumber

objContactItem  Required. An expression that returns a ContactItem object.


BusinessHomePage Property

Returns or sets the URL of the business Web page for the contact.

Read/write String.

Syntax

objContactItem.BusinessHomePage

objContactItem  Required. An expression that returns a ContactItem object.


BusinessTelephoneNumber Property

Returns or sets the first business telephone number for the contact.

Read/write String.

Syntax

objContactItem.BusinessTelephoneNumber

objContactItem  Required. An expression that returns a ContactItem object.


BusyStatus Property

Returns or sets the busy status of the user for the appointment. Can be one of the following OlBusyStatus constants: olBusy, olFree, olOutOfOffice, or olTentative.

Read/write Long.

Syntax

objAppointmentItem.BusyStatus

objAppointmentItem  Required. An expression that returns an AppointmentItem object.


CallbackTelephoneNumber Property

Returns or sets the callback telephone number for the contact.

Read/write String.

Syntax

objContactItem.CallbackTelephoneNumber

objContactItem  Required. An expression that returns a ContactItem object.


CardData Property

Returns or sets the text of the card data for the task.

Read/write String.

Syntax

objTaskItem.CardData

objTaskItem  Required. An expression that returns a TaskItem object.


CarTelephoneNumber Property

Returns or sets the car telephone number for the contact.

Read/write String.

Syntax

objContactItem.CarTelephoneNumber

objContactItem  Required. An expression that returns a ContactItem object.


Categories Property

Returns or sets the categories assigned to the Outlook item.

Read/write String.

Syntax

object.Categories

object  Required. An expression that returns an Outlook object.


Category Property

Returns or sets the category assigned to the form description.

Read/write String.

Syntax

objFormDescription.Category

objFormDescription   Required. An expression that returns a FormDescription object.


CategorySub Property

Returns or sets the subcategory assigned to the form description.

Read/write String.

Syntax

objFormDescription.CategorySub

objFormDescription   Required. An expression that returns a FormDescription object.


CC Property

Returns the display list of carbon copy (CC) names for the Recipient. This property contains the display names only. The Recipients collection should be used to modify the CC recipients.

Read-only String.

Syntax

objMailItem.CC

objMailItem   Required. An expression that returns a MailItem object.


Children Property

Returns or sets the names of the children of the contact.

Read/write String.

Syntax

objContactItem.Children

objContactItem  Required. An expression that returns a ContactItem object.


ClearRecurrencePattern Method

Removes the recurrence settings and restores the single-occurrence state for an appointment or task.

Syntax

object.ClearRecurrencePattern

object  Required. An expression that returns an AppointmentItem or TaskItem object.


Color Property

Returns or sets the color of the note. Can be one of the following OlNoteColor constants: olBlue, olGreen, olPink, olWhite, or olYellow.

Read/write Long.

Syntax

objNoteItem.Color

objNoteItem   Required. An expression that returns a NoteItem object.


Color Property Example

This example creates a new NoteItem and sets the color to blue.

Set myItem = myOlApp.CreateItem(olNoteItem)

myItem.Color = olBlue


CommandBars Property

Returns a CommandBars collection object that represents all the menus and toolbars in the Explorer or Inspector.

Read-only.

Syntax

object.CommandBars

object   Required. An expression that returns an Explorer or Inspector object.


Comment Property

Returns or sets the text of a comment assigned to the form description. Read/write String.

Syntax

objFormDescription.Comment

objFormDescription   Required. An expression that returns a FormDescription object.


Companies Property

Returns or sets the names of the companies associated with the Outlook item. This is a free-form text field.

Read/write String.

Syntax

object.Companies

object   Required. An expression that returns an Outlook object.


CompanyAndFullName Property

Returns the concatenated company name and full name for the contact.

Read-only String.

Syntax

objContactItem.CompanyAndFullName

objContactItem   Required. An expression that returns a ContactItem object.


CompanyMainTelephoneNumber Property

Returns or sets the company main telephone number for the contact.

Read/write String.

Syntax

objContactItem.CompanyMainTelephoneNumber

objContactItem   Required. An expression that returns a ContactItem object.


CompanyName Property

Returns or sets the company name for the contact.

Read/write String.

Syntax

objContactItem.CompanyName

objContactItem   Required. An expression that returns a ContactItem object.


Complete Property

True if the task is completed.

Read/write Boolean.

Syntax

objTaskItem.Complete

objTaskItem   Required. An expression that returns a TaskItem object.


ComputerNetworkName Property

Returns or sets the name of the computer network for the contact.

Read/write String.

Syntax

objContactItem.ComputerNetworkName

objContactItem   Required. An expression that returns a ContactItem object.


ContactName Property

Returns or sets the name of the person to contact for information regarding the custom form for this FormDescription object.

Read/write String.

Syntax

objFormDescription.ContactName

objFormDescription   Required. An expression that returns a FormDescription object.


ContactNames Property

Returns the contact names associated with the journal entry. This property contains the display names for the contacts only. Use the Recipients collection to modify the contents of this string.

Read-only String.

objJournalItem.ContactName

objJournalItem   Required. An expression that returns a JournalItem object.


Contacts Property

Returns the contact names associated with the task. This property contains the display names for the contacts only. Use the Recipients collection to modify the contents of this string.

Read-only String.

Syntax

objTaskItem.Contacts

objTaskItem   Required. An expression that returns a TaskItem object.


ConversationIndex Property

Returns the index of the conversation thread of the mail message or post.

Read-only String.

Syntax

object.ConversationIndex

object   Required. An expression that returns a MailItem or a PostItem object.


ConversationTopic Property

Returns the topic of the conversation thread of the mail message or post.

Read-only String.

Syntax

object.ConversationTopic

object   Required. An expression that returns a MailItem or a PostItem object.


Copy Method

Creates and returns a copy of the object. This method is supported by all Outlook items.

Syntax

object.Copy

object    Required. An expression that returns an Outlook object that belongs to the Items collection.


Copy Method Example

This example creates a mail message, uses the Copy method to copy it, then moves the copy into the default Inbox folder.

Dim myOlApp As Outlook.Application

Dim myNamespace As Outlook.NameSpace

Dim myFolder As Outlook.MAPIFolder

Dim myItem As Outlook.Item

Dim myCopiedItem As Outlook.Item

Set myOlApp = CreateObject("Outlook.Application")

Set myNamespace = myOlApp.GetNamespace("MAPI")

Set myFolder = myNamespace.GetDefaultFolder(olFolderInbox)

Set myItem = myOlApp.CreateItem(olMailItem)

Set myCopiedItem = myItem.Copy

myCopiedItem.Move myFolder


CopyLike Property

Returns or sets the property inheritance style to use for the action. The inheritance style is used when the action is executed to control how properties are copied to the new item created by the action. Can be one of the following OlActionCopyLike constants: olForward, olReply, olReplyAll, olReplyFolder, or olRespond.

Read/write Long.

Syntax

objAction.Copy

objAction    Required. An expression that returns an Action object.


CopyTo Method

Copies the current folder in its entirety to the destination folder. Returns a MAPIFolder object that represents the new copy.

Syntax

objMAPIFolder.CopyTo(DestFldr)

objMAPIFolder   Required. An expression that returns a MAPIFolder object (current folder).

DestFldr   Required. A MAPIFolder object. (The destination folder for the copied folder).


CopyTo Method Example

This example uses the CopyTo method to copy the current folder (in this case, the default Contacts folder) to the default Inbox folder.

Dim myOlApp As Outlook.Application

Dim myNamespace As Outlook.NameSpace

Dim myInboxFolder As Outlook.MAPIFolder

Dim myCurrentFolder As Outlook.MAPIFolder

Dim myNewFolder As Outlook.MAPIFolder

Set myInboxFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

Set myCurrentFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

Set myNewFolder = myCurrentFolder.CopyTo(myInboxFolder)


Count Property

Returns the count of objects in the collection.

Read-only Long.

Syntax

collobject.Count

collobject    Required. An expression that returns an Outlook collection object.


CreateItem Method

Creates a new Outlook item and returns it.

Syntax

objApplication.CreateItem(ItemType)

objApplication    Required. An expression that returns an Application object.

ItemType   Required Long. The Outlook item Type for the new item. Can be one of the following OlItemType constants: olAppointmentItem, olContactItem, olJournalItem, olMailItem, olNoteItem, olPostItem, or olTaskItem.


CreateItem Method Example

This example uses the CreateItem method to create a new contact in the default Contacts folder and then displays the new item.

Dim myOlApp As Outlook.Application

Dim myNameSpace As Outlook.NameSpace

Dim myFolder As Outlook.MAPIFolder

Dim myItem As Outlook.Item

Set myOlApp = CreateObject(“Outlook.Application”)

Set myNameSpace = myOlApp.GetNameSpace(“MAPI”)

Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

Set myItem = myOlApp.CreateItem(olContactItem)

myItem.Display


CreateItemFromTemplate Method

Creates a new Outlook item from an Outlook template (.oft) and returns the new item.

Syntax

objApplication.CreateItemFromTemplate(TemplatePath, [InFolder])

objApplication     Required. An expression that returns an Application object.

TemplatePath   Required String. The path and file name of the Outlook template for the new item.

InFolder   Optional Variant. The folder in which the item is to be created. If this argument is omitted, the default folder for the item type will be used.


CreateRecipient Method

Creates and returns a Recipient object. This method is most commonly used to create a Recipient object for use with the GetSharedDefaultFolder method (for example, to open a delegator's folder). It can also be used to verify a given name against an address book.

Syntax

objNameSpace.CreateRecipient(RecipientName)

objNameSpace     Required. An expression that returns a NameSpace object.

RecipientName   Required String. The display name of the recipient.


CreateRecipient Method Example

This example uses the CreateRecipient method to obtain the default Calendar folder for the user Eric Lang.

Set myRecipient = myNameSpace.CreateRecipient("Eric Lang")

Set hisCalendar = myNameSpace.GetSharedDefaultFolder _

    (myRecipient, olFolderCalendar)


CreationTime Property

Returns the creation time for the Outlook item. This property corresponds to the MAPI property PR_CREATION_TIME.

Read-only Date.

Syntax

object.CreationTime

object    Required. An expression that returns an Outlook item that belongs to the Items collection.


CurrentFolder Property

Returns or sets a MAPIFolder object that represents the current folder displayed in the explorer. Use this property to change the folder the user is viewing.

Read/write MAPIFolder.

Syntax

objExplorer.CurrentFolder

objExplorer    Required. An expression that returns an Explorer object.


CurrentFolder Property Example

This example uses the CurrentFolder property to change the displayed folder to the user’s Calendar folder.

Set myOlApp.ActiveExplorer.CurrentFolder = _

    olNameSpace.GetDefaultFolder(olFolderCalendar)


CurrentItem Property

Returns the current item being displayed in the inspector.

Read-only.

Syntax

objInspector.CurrentItem

objInspector    Required. An expression that returns an Inspector object.


CurrentItem Property Example

This example uses the CurrentItem property to obtain the current item that the user is viewing.

Set myItem = myOlApp.ActiveInspector.CurrentItem


CurrentUser Property

Returns the currently logged-on user as a Recipient object. Read-only.

Syntax

objNameSpace.CurrentUser

objNameSpace    Required. An expression that returns a NameSpace object.


CurrentUser Property Example

This example uses the CurrentUser property to obtain the name of the currently logged-on user and then displays a message box containing the name.

MsgBox myNameSpace.CurrentUser.Name


CustomerID Property

Returns the customer ID for the contact.

Read/write String.

Syntax

objContactItem.CustomerID

objContactItem    Required. An expression that returns a ContactItem object.


DateCompleted Property

Returns or sets the completion date of the task.

Read/write Date.

Syntax

objTaskItem.DateCompleted

objTaskItem    Required. An expression that returns a TaskItem object.


DayOfMonth Property

Returns or sets the day of the month on which the recurring appointment or task occurs.

Read/write Long.

Syntax

objRecurrencePattern.DayOfMonth

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


DayOfWeekMask Property

Returns or sets the mask for the days of the week on which the recurring appointment or task occurs. Monthly and yearly patterns are only valid for a single day. Weekly patterns are only valid as the Or of the DayOfWeekMask. Can be one of or a sum of the following OlDaysOfWeek constants: olSunday, olMonday, olTuesday, olWednesday, olThursday, olFriday, or olSaturday.

Read/write Long.

Syntax

objRecurrencePattern.DayOfWeekMask

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


DefaultItemType Property

Returns the default Outlook item type contained in the folder. Can be one of the following OlItemType constants: olAppointmentItem, olContactItem, olJournalItem, olMailItem, olNoteItem, olPostItem, or olTaskItem.

Read-only Long.

Syntax

objMAPIFolder.DefaultItemType

objMAPIFolder    Required. An expression that returns a MAPIFolder object.


DefaultMessageClass Property

Returns the default message class for items in the folder.

Read-only String.

Syntax

objMAPIFolder.DefaultMessageClass

objMAPIFolder    Required. An expression that returns a MAPIFolder object.


DeferredDeliveryTime Property

Returns or sets the date and time the mail message is to be delivered. This property corresponds to the MAPI property PR_DEFERRED_DELIVERY_TIME.

Read/write Date.

Syntax

objMailItem.DeferredDeliveryTime

objMailItem    Required. An expression that returns a MailItem object.


DelegationState Property

Returns the delegation state of the task. Can be one of the following OlTaskDelegationState constants: olTaskDelegationAccepted, olTaskDelegationDeclined, olTaskDelegationUnknown or olTaskNotDelegated.

Read-only Long.

Syntax

objTaskItem.DelegationState

objTaskItem    Required. An expression that returns a TaskItem object.


Delegator Property

Returns the display name of the delegator for the task.

Read-only String.

Syntax

objTaskItem.Delegator

objTaskItem    Required. An expression that returns a TaskItem object.


Delete Method

Deletes the object from the collection.

Syntax

object.Delete

object   Required. An expression that returns an object that belongs to the Items collection.


DeleteAfterSubmit Property

True if a copy of the mail message is not saved upon being sent. False if a copy is saved.

Read/write Boolean.

Syntax

objMailItem.DeleteAfterSubmit

objMailItem    Required. An expression that returns a MailItem object.


Department Property

Returns or sets the department name for the contact.

Read/write String.

Syntax

objContactItem.Department

objContactItem    Required. An expression that returns a ContactItem object.


Description Property

Returns or sets the description of the folder. Corresponds to the Description box in the Properties dialog box for the folder. This property corresponds to the MAPI property PR_COMMENT.

Read/write String.

Syntax

objMAPIFolder.Description

objMAPIFolder    Required. An expression that returns a MAPIFolder object.


Display Method

For a MAPIFolder object, the Display method displays a new Explorer object for the folder.

For Outlook items,it displays a new Inspector object for the item.

For Inspector and Explorer objects, the Display method displays the existing inspector or explorer.

Syntax 1

object.Display

Syntax 2

object.Display([Modal])

object   Required. An expression that returns an Explorer or MAPIFolder object (Syntax 1) or an Outlook item or Inspector object (Syntax 2).

Modal   Optional Boolean. True to make the inspector modal. The default value is False.


Display Method Example

This example uses the Display method to display the default Inbox folder.

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

myFolder.Display

This example displays the first item in the Inbox folder.

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

myFolder.Items(1).Display


DocPosted Property

True if the journalized item was posted as part of the journalized session.

Read/write Boolean.

Syntax

objJournalItem.DocPosted

objJournalItem    Required. An expression that returns a JournalItem object.


DocPrinted Property

True if the journalized item was printed as part of the journalized session.

Read/write Boolean.

Syntax

objJournalItem.DocPrinted

objJournalItem    Required. An expression that returns a JournalItem object.


DocRouted Property

True if the journalized item was routed as part of the journalized session.

Read/write Boolean.

Syntax

objJournalItem.DocRouted

objJournalItem    Required. An expression that returns a JournalItem object.


DocSaved Property

True if the journalized item was saved as part of the journalized session.

Read/write Boolean.

Syntax

objJournalItem.DocSaved

objJournalItem    Required. An expression that returns a JournalItem object.


DueDate Property

Returns or sets the due date for the task.

Read/write Date.

Syntax

objTaskItem.DueDate

objTaskItem    Required. An expression that returns a TaskItem object.


Duration Property

Returns or sets the duration (in minutes) of the appointment, journal entry, or recurrence pattern. For recurrences, this property is only valid for appointments.

Read/write Long.

Syntax

object.Duration

object    Required. An expression that returns an AppointmentItem, RecurrencePattern, or JournalItem object.


Email1Address Property

Returns or sets the e-mail address of the first e-mail entry for the contact.

Read/write String.

Syntax

objContactItem.Email1Address

objContactItem    Required. An expression that returns a ContactItem object.


Email1Address Property Example

This example sets "Jsmith@msn.com" as the e-mail address for the first e-mail entry of a contact.

myItem.Email1Address = "Jsmith@msn.com"


Email1AddressType Property

Returns or sets the address type (such as EX or SMTP) of the first e-mail entry for the contact. This is a free-form text field, but it must match the actual type of an existing mail transport.

Read/write String.

Syntax

objContactItem.Email1AddressType

objContactItem    Required. An expression that returns a ContactItem object.


Email1AddressType Property Example

This example sets "SMTP" as the address type for the first e-mail entry of a contact.

myItem.Email1AddressType = "SMTP"


Email1DisplayName Property

Returns the display name of the first e-mail address for the contact. This property is set to the value of the FullName property by default.

Read-only String.

Syntax

objContactItem.Email1DisplayName

objContactItem    Required. An expression that returns a ContactItem object.


Email1EntryID Property

Returns the entry ID of the first e-mail address for the contact.

Read-only String.

Syntax

objContactItem.Email1EntryID

objContactItem    Required. An expression that returns a ContactItem object.


Email2Address Property

Returns or sets the e-mail address of the second e-mail entry for the contact.

Read/write String.

Syntax

objContactItem.Email2Address

objContactItem    Required. An expression that returns a ContactItem object.


Email2Address Property Example

This example sets "Jsmith@msn.com" as the e-mail address for the second e-mail entry of a contact.

myItem.Email2Address = "Jsmith@msn.com"


Email2AddressType Property

Returns or sets the address type (such as EX or SMTP) of the second e-mail entry for the contact. This is a free-form text field, but it must match the actual type of an existing mail transport.

Read/write String.

Syntax

objContactItem.Email2AddressType

objContactItem    Required. An expression that returns a ContactItem object.


Email2AddressType Property Example

This example sets "SMTP" as the address type for the second e-mail entry of a contact.

myItem.Email2AddressType = "SMTP"


Email2DisplayName Property

Returns the display name of the second e-mail entry for the contact. This property is set to the value of the FullName property by default.

Read-only String.

Syntax

objContactItem.Email2DisplayName

objContactItem    Required. An expression that returns a ContactItem object.


Email2EntryID Property

Returns the entry ID of the second e-mail entry for the contact.

Read-only String.

Syntax

objContactItem.Email2EntryID

objContactItem    Required. An expression that returns a ContactItem object.


Email3Address Property

Returns or sets the e-mail address of the third e-mail entry for the contact.

Read/write String.

Syntax

objContactItem.Email3Address

objContactItem    Required. An expression that returns a ContactItem object.


Email3Address Property Example

This example sets "Jsmith@msn.com" as the e-mail address for the third e-mail entry of a contact.

myItem.Email3Address = "Jsmith@msn.com"


Email3AddressType Property

Returns or sets the address type (such as EX or SMTP) of the third e-mail entry for the contact. This is a free-form text field, but it must match the actual type of an existing mail transport.

Read/write String.

Syntax

objContactItem.Email3AddressType

objContactItem    Required. An expression that returns a ContactItem object.


Email3AddressType Property Example

This example sets "SMTP" as the address type for the third e-mail entry of a contact.

myItem.Email3AddressType = "SMTP"


Email3DisplayName Property

Returns the display name of the third e-mail entry for the contact. This property is set to the value of the FullName property by default.

Read-only String.

Syntax

objContactItem.Email3DisplayName

objContactItem    Required. An expression that returns a ContactItem object.


Email3EntryID Property

Returns the entry ID of the third e-mail entry for the contact.

Read-only String.

Syntax

objContactItem.Email3EntryID

objContactItem    Required. An expression that returns a ContactItem object.


Enabled Property

True if the action is enabled in the application.

Read/write Boolean.

Syntax

objAction.Enabled

objAction    Required. An expression that returns an Action object.


End Property

Returns or sets the end date and time of an appointment or journal entry.

Read/write Date.

Syntax

object.End

object    Required. An expression that returns an AppointmentItem or a JournalItem object.


EndTime Property

Returns or sets the end time for a recurrence pattern. This property is only valid for appointments.

Read/write Date.

Syntax

objRecurrencePattern.End

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


EntryID Property

Returns the unique entry ID of the object. This property corresponds to the MAPI property PR_ENTRYID. MAPI systems assign a permanent, unique ID string when an object is created that does not change from one MAPI session to another. The EntryID property is not set for an Outlook item until it is saved or sent.

Read-only String.

Syntax

object.EntryID

object    Required. An expression that returns an Outlook object that belongs to the Items collection.


EntryID Property Example

This example uses the EntryID property to compare the entry ID of one message to the entry ID of a message returned by a search operation to determine whether the objects represent the same message.

If myItem.EntryID = myFoundItem.EntryID Then

    MsgBox "These two message objects refer to the same message."

End If


Execute Method

Executes the action for the item. Returns the Outlook item created by the action.

Syntax

objAction.Execute

objAction   Required. An expression that returns an Action object.


Execute Method Example

This example uses the Execute method to look through the all the actions for the given mail message, and executes the action called "Reply to All."

For Each a In myItem.Actions

    If a.Name = "Reply to All" Then

        Set myItem2 = a.Execute

        Exit For

    End If

Next a


ExpiryTime Property

Returns or sets the date and time at which the mail message becomes invalid and can be deleted.

Read/write Date.

Syntax

objMailItem.ExpiryTime

objItem   Required. An expression that returns a MailItem or object.


FileAs Property

Returns or sets the default keyword string assigned to the contact when it is filed.

Read/write String.

Syntax

objContactItem.FileAs

objContactItem   Required. An expression that returns a ContactItem object.


FindNext Method

After the Find method runs, this method finds and returns the next Outlook item in the collection. The search operation begins from the current position, which matches the expression previously set through Find.

Syntax

objItems.FindNext

objItems   Required. An expression that returns an Items collection object.


FindNext Method Example

This example uses the GetDefaultFolder method to return the MAPIFolder object that represents the default Calendar folder for the current user. It then uses the Find and FindNext methods to locate all the appointments that occur today and display them in a series of message boxes.

tdystart = Format(Date, "Short Date") & " 12:00 AM"

tdyend = Format(Date, "Short Date") & " 11:59 PM"

Set myAppointments = myNameSpace.GetDefaultFolder _

    (olFolderCalendar).Items

Set currentAppointment = myAppointments.Find("[Start] >= """ & _

    tdystart & """ and [Start] <= """ & tdyend & """")

While TypeName(currentAppointment) <> "Nothing"

    MsgBox currentAppointment.Subject

    Set currentAppointment = myAppointments.FindNext

Wend


FirstName Property

Returns or sets the first name for the contact.

Read/write String.

Syntax

objContactItem.FirstName

objContactItem   Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the FullName property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes of entries to FullName.


FlagDueBy Property

Returns or sets the date by which this mail message is due. This property is only valid if the FlagStatus property is also set for the message. This property corresponds to the MAPI property PR_REPLY_TIME.

Read/write Date.

Syntax

objMailItem.FlagDueBy

objContactItem   Required. An expression that returns a MailItem object.


FlagRequest Property

Returns or sets the requested action for the mail message. This is a free-form text field. This property is only valid if the FlagStatus property is also set for the message.

Read/write String.

Syntax

objMailItem.FlagRequest

objMailItem   Required. An expression that returns a MailItem object.


FlagStatus Property

Returns or sets the flag status for the mail message. Can be one of the following OlFlagStatus constants: olFlagComplete, olFlagMarked, or olNoFlag.

Read/write Long.

Syntax

objMailItem.FlagStatus

objMailItem   Required. An expression that returns a MailItem object.


Folders Property

Returns the Folders collection that represents all the folders contained in the specified folder or name space. The NameSpace object is the root of all the folders for the given name space.

Read-only.

Syntax

object.Folders

object   Required. An expression that returns a MAPIFolder object or a NameSpace object.


FormDescription Property

Returns the FormDescription object that represents the form description for the Outlook item.

Read-only.

Syntax

object.FormDescription

object   Required. An expression that returns an Outlook item that belongs to the Items collection.


Formula Property

Returns or sets the formula for the user property.

Read/write String.

Syntax

objUserProperty.Formula

objUserProperty    Required. An expression that returns a UserProperty object.


Forward Method

Executes the Forward action for the journal entry, mail message, or post. Returns the resulting copy as a new object.

Syntax

object.Forward

object   Required. An expression that returns a JournalItem, MailItem, or PostItem object.


Forward Method Example

This example uses the GetDefaultFolder method to return the MAPIFolder object that represents the default Inbox folder for the current user. It then uses the Forward method to retrieve the first message in the default Inbox folder and forward it to Laura Jennings. The Add method is used to add Laura Jennings to the Recipients collection and the Send method sends the item to all recipients. It is assumed that the name will resolve unambiguously in the Address Book.

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

Set myForward = myFolder.Items(1).Forward

myForward.Recipients.Add "Laura Jennings"

myForward.Send


FTPSite Property

Returns the FTP site entry for the contact.

Read/write String.

Syntax

objContactItem.FTPSite

objContactItem    Required. An expression that returns a ContactItem object.


FullName Property

Returns or sets the whole, unparsed full name for the contact.

Read/write String.

Syntax

objContactItem.FullName

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed into the FirstName, LastName, MiddleName and Suffix properties, which may be changed or entered independently should they be parsed incorrectly. Note that any such changes or entries to the FirstName, LastName, MiddleName or Suffix properties will be overwritten by any subsequent changes or entries to FullName.


FullNameAndCompany Property

Returns the full name and company of the contact by concatenating the values of the FullName and CompanyName properties.

Read-only String.

Syntax

objContactItem.FullNameAndCompany

objContactItem    Required. An expression that returns a ContactItem object.


Gender Property

Returns or sets the gender of the contact. Can be one of the following OlGender constants: olFemale, olMale, or olUnspecified.

Read/write Long.

Syntax

objContactItem.Gender

objContactItem    Required. An expression that returns a ContactItem object.


GetAssociatedAppointment Method

Returns an AppointmentItem object that represents the appointment associated with the meeting request.

Syntax

objMeetingItem.GetAssociatedAppointment(AddToCalendar)

objMeetingItem    Required. An expression that returns a MeetingItem object.

AddToCalendar   Required Boolean. True to add the meeting to the default Calendar folder.


GetAssociatedAppointment Method Example

This example finds a MeetingItem in the default Inbox folder and adds the associated appointment to the Calendar folder.

Set myFolder = _

    myNameSpace.GetDefaultFolder(olFolderInbox)

Set myMtgReq = myFolder.Items.Find("[MessageClass] = _

    'IPM.Schedule.Meeting.Request'")

If TypeName(myMtgReq) <> "Nothing" Then

   Set myAppt = myMtgReq.GetAssociatedAppointment(True)

End If

This example accepts a meeting request, sending the response without displaying the inspector.

Set myNewMeeting =myMtgReq.GetAssociatedAppointment(True)

myNewMeeting.Respond olResponseAccepted, True


GetAssociatedTask Method

Returns a TaskItem object that represents the requested task.

Syntax

objTaskRequestItem.GetAssociatedTask(AddToTaskList)

objTaskRequestItem   Required. An expression that returns a TaskRequestItem object.

AddToTaskList   Required Boolean. True if the task is added to the default Tasks folder.


GetAssociatedTask Method Example

This example accepts a TaskRequestItem, sending the response without displaying the inspector.

Set myNewTaskItem = myTaskRequestItem.GetAssociatedTask(True)

myNewTaskItem.Respond olResponseAccepted, True


GetDefaultFolder Method

Returns a MAPIFolder object that represents the default folder of the requested type for the current profile (for example, obtaining the default Calendar folder for the user who is currently logged on).

Syntax

objNameSpace.GetDefaultFolder(FolderTypeEnum)

objNameSpace    Required. An expression that returns a NameSpace object.

FolderTypeEnum   Required Long. The type of default folder to return. Can be one of the following OlDefaultFolders constants: olFolderCalendar, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderInbox, olFolderJournal, olFolderNotes, olFolderOutbox, olFolderSentMail, or olFolderTasks.


GetDefaultFolder Method Example

This example uses the GetDefaultFolder method to obtain the default Calendar folder for the current user.

set myCalendar = myNameSpace.GetDefaultFolder(olFolderCalendar)


GetFolderFromID Method

Returns a MAPIFolder object identified by the specified entry ID (if valid). This method is used for ease of transition between MAPI and OLE/Messaging applications and Outlook.

Syntax

objNameSpace .GetFolderFromID(EntryIDFolder, [StoreID])

objNameSpace    Required. An expression that returns a NameSpace object.

EntryIDFolder   Required String. The EntryID of the folder.

StoreID   Optional String. The StoreID for the folder.


GetItemFromID Method

Returns an Outlook item identified by the specified entry ID (if valid). This method is used for ease of transition between MAPI and OLE/Messaging applications and Outlook.

Syntax

objNameSpace.GetItemFromID(EntryIDItem, [StoreID])

objNameSpace    Required. An expression that returns a NameSpace object.

EntryIDItem   Required String. The EntryID of the item.

StoreID   Optional String. The StoreID for the folder.


GetNameSpace Method

Returns a NameSpace object of the specified type.

Syntax

objApplication.GetNameSpace(Type)

objApplication   Required. An expression that returns an Application object.

Type   Required String. The type of name space to return.

Remarks

The only supported name space type is "MAPI".


GetNameSpace Method Example

This example uses GetNameSpace to obtain the MAPI NameSpace object.

set myOlApp = CreateObject ("Outlook.Application")

Set myNameSpace = myOlApp.GetNameSpace("MAPI")


GetRecipientFromID Method

Returns a Recipient object identified by the specified entry ID (if valid). This method is used for ease of transition between MAPI and OLE/Messaging applications and Outlook.

Syntax

objNameSpace.GetRecipientFromID(EntryID)

objNameSpace    Required. An expression that returns a NameSpace object.

EntryID   Required String. The EntryID of the recipient.


GetRecurrencePattern Method

Returns a RecurrencePattern object that represents the recurrence attributes of an appointment or task. If there is no existing recurrence pattern, a new, empty RecurrencePattern object is returned.

Syntax

object.GetRecurrencePattern

object Required. An expression that returns an AppointmentItem or TaskItem object.


GetRecurrencePattern Method Example

This example uses GetRecurrencePattern to obtain the RecurrencePattern for an appointment.

Set myPattern = myAppointment.GetRecurrencePattern


GovernmentIDNumber Property

Returns or sets the government ID number for the contact.

Read/write String.

Syntax

objContactItem.GovernmentIDNumber

objContactItem    Required. An expression that returns a ContactItem object.


HasAttachment Property

True if  the remote item has an attachment associated with it. The default value is True.

Read-only Boolean.

Syntax

objRemoteItem.HasAttachment

objRemoteItem    Required. An expression that returns a RemoteItem object.


Height Property

Returns or sets the height (in pixels) of the note.

Read/write Long.

Syntax

objNoteItem.Height

objNoteItem    Required. An expression that returns a NoteItem object.


HideFormPage Method

Hides a form page in the inspector.

Syntax

objInspector.HideFormPage(PageName)

objInspector   Required. An expression that returns an Inspector object.

PageName    Required String. The display name of the page to be hidden.


Hobby Property

Returns or sets the hobby for the contact.

Read/write String.

Syntax

objContactItem.Hobby

objContactItem    Required. An expression that returns a ContactItem object.


Home2TelephoneNumber Property

Returns or sets the second home telephone number for the contact.

Read/write String.

Syntax

objContactItem.Home2TelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


HomeAddress Property

Returns or sets the full, unparsed text of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddress

objContactItem    Required. An expression that returns a ContactItem object.


HomeAddressCity Property

Returns or sets the city portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressCity

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeAddressCountry Property

Returns or sets the country portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressCountry

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeAddressPostalCode Property

Returns or sets the postal code portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressPostalCode

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeAddressPostOfficeBox Property

Returns or sets the post office box number portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressPostOfficeBox

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeAddressState Property

Returns or sets the state portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressState

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeAddressStreet Property

Returns or sets the street portion of the home address for the contact.

Read/write String.

Syntax

objContactItem.HomeAddressStreet

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the HomeAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to HomeAddress.


HomeFaxNumber Property

Returns or sets the home fax number for the contact.

Read/write String.

Syntax

objContactItem.HomeFaxNumber

objContactItem    Required. An expression that returns a ContactItem object.


HomeTelephoneNumber Property

Returns or sets the first home telephone number for the contact.

Read/write String.

Syntax

objContactItem.HomeTelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


Icon Property

Returns or sets the file name of the icon to be displayed for the form.

Read/write String.

Syntax

objFormDescription.Icon

objFormDescription   Required. An expression that returns a FormDescription object.


Importance Property

Returns or sets the relative importance level for the Outlook item. Can be one of the following OlImportance constants: olImportanceHigh, olImportanceLow, or olImportanceNormal. This property corresponds to the MAPI property PR_IMPORTANCE.

Read/write Long.

Syntax

object.Importance

object    Required. An expression that returns an Outlook object that belongs to the Items collection.


Initials Property

Returns or sets the initials for the contact.

Read/write String.

Syntax

objContactItem.Initials

objContactItem    Required. An expression that returns a ContactItem object.


Interval Property

Returns or sets the number of units of a given recurrence type between occurrences. For example, setting the Interval property to 2 and the RecurrenceType property to "Weekly" would cause the pattern to occur every second week.

Read/write Long.

Syntax

objRecurrencePattern.Interval

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.

Note   This property is not valid for yearly recurrence patterns.


ISDNNumber Property

Returns or sets the ISDN number for the contact.

Read/write String.

Syntax

objContactItem.ISDNNumber

objContactItem    Required. An expression that returns a ContactItem object.


IsRecurring Property

True if the appointment or task is a recurring appointment or task. When the GetRecurrencePattern method is used with an AppointmentItem or TaskItem object, this property is set to True.

Read-only Boolean.

Syntax

object.IsRecurring

object    Required. An expression that returns a TaskItem or an AppointmentItem object.


Items Property

Returns the collection of Outlook items in the folder.

Read-only.

Syntax

objMAPIFolder.Items

objMAPIFolder    Required. An expression that returns a MAPIFolder object.


Items Property Example

This example uses the Items property to obtain the collection of MailItem objects from the default Inbox folder.

Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)

Set myItems = myFolder.Items


JobTitle Property

Returns or sets the job title for the contact.

Read/write String.

Syntax

objContactItem.JobTitle

objContactItem    Required. An expression that returns a ContactItem object.


Journal Property

True if the transaction of the contact will be journalized. The default value is False.

Read/write Boolean.

Syntax

objContactItem.Journal

objContactItem    Required. An expression that returns a ContactItem object.


Language Property

Returns or sets the language for the contact.

Read/write String.

Syntax

objContactItem.Language

objContactItem    Required. An expression that returns a ContactItem object.


LastModificationTime Property

Returns the time that the Outlook item was last modified. This property corresponds to the MAPI property PR_LAST_MODIFICATION_TIME.

Read-only Date.

Syntax

object.LastModificationTime

object    Required. An expression that returns an Outlook object that belongs to the Items collection.


LastName Property

Returns or sets the last name for the contact.

Read/write String.

Syntax

objContactItem.LastName

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the FullName property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes of entries to FullName.


LastNameAndFirstName Property

Returns the concatenated last name and first name for the contact.

Read-only String.

Syntax

objContactItem.LastNameAndFirstName

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the FirstName and LastName properties for the contact, which are themselves parsed from the FullName property.


Left Property

Returns or sets the position (in pixels) of the left vertical edge of the note.

Read/write Long.

Syntax

objNoteItem.Left

objNoteItem    Required. An expression that returns a NoteItem object.


Locked Property

True if the form cannot be modified.

Read/write Boolean.

Syntax

objFormDescription.Locked

objFormDescription    Required. An expression that returns a FormDescription object.


Logoff Method

Logs the user off from the current MAPI session.

Syntax

objNameSpace.Logoff

objNameSpace   An expression that returns a NameSpace object.


Logon Method

Logs the user on to MAPI, obtaining a MAPI session.

Syntax

objNameSpace.Logon([Profile,] [Password,] ]ShowDialog,] [NewSession])

objNameSpace    An expression that returns a NameSpace object.

Profile   Optional String. The profile name to use for the session.

Password   Optional String. The password (if any) associated with the profile.

ShowDialog   Optional Boolean. True to display the MAPI logon dialog.

NewSession   Optional Boolean. True to create a new session (doesn't use an existing session).


MailingAddress Property

Returns or sets the full, unparsed selected mailing address for the contact.

Read/write String.

Syntax

objContactItem.MailingAddress

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressCity Property

Returns or sets the city name portion of the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressCity

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressCountry Property

Returns or sets the country code portion of the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressCountry

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressPostOfficeBox Property

Returns or sets the post office box number portion of the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressPostOfficeBox

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressPostalCode Property

Returns or sets the postal code (zip code) portion of the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressPostalCode

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressState Property

Returns or sets the state code portion for the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressState

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


MailingAddressStreet Property

Returns or sets the street address portion of the selected mailing address of the contact.

Read/write String.

Syntax

objContactItem.MailingAddressStreet

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property replicates the property indicated by the SelectedMailingAddress property, which is one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther. While it can be changed or entered independently, any such changes or entries to this property will be overwritten by any subsequent changes or entries to the property indicated by SelectedMailingAddress.


ManagerName Property

Returns or sets the manager name for the contact.

Read/write String.

Syntax

objContactItem.ManagerName

objContactItem    Required. An expression that returns a ContactItem object.


MarkComplete Method

Marks the task as completed. Sets PercentComplete to "100%", Complete to True, and DateCompleted to the current date.

Syntax

objTaskItem.MarkComplete

objTaskItem   Required. An expression that returns a TaskItem object.


MeetingStatus Property

Returns or sets the meeting status of the appointment. Use this property to make a MeetingItem object available for the appointment. Can be one of the following OlMeetingStatus constants: olMeeting, olMeetingCanceled, olMeetingReceived, or olNonMeeting.

Read/write Long.

Syntax

objAppointmentItem.MeetingStatus

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


MessageClass Property

Returns or sets the message class for the Outlook item or Action. This property corresponds to the MAPI property PR_MESSAGE_CLASS. The MessageClass property links the item to the form on which it is based. When an item is selected, Outlook uses the message class to locate the form and expose its properties, such as Reply commands.

Read/write String.

Syntax

object.MessageClass

object   Required. An expression that returns an Action object or an Outlook object that belongs to the Items collection.


MiddleName Property

Returns or sets the middle name for the contact.

Read/write String.

Syntax

objContactItem.MiddleName

objContactItem   Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the FullName property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes of entries to FullName.


Mileage Property

Returns or sets the mileage for the appointment, contact, or task. This is a free-form string field and can be used to store mileage information associated with the item (for example, 100 miles documented for a task) for purposes of reimbursement.

Read/write String.

Syntax

object.Mileage

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


MiniIcon Property

Returns or sets the file name of the mini-icon to be displayed for the form.

Read/write String.

Syntax

objFormDescription.MiniIcon

objFormDescription   Required. An expression that returns a FormDescription object.


MobileTelephoneNumber Property

Returns or sets the mobile telephone number for the contact.

Read/write String.

Syntax

objContactItem.MobileTelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


ModifiedFormPages Property

Returns the Pages collection that represents all the pages for the item in the inspector. The main page and up to three customizable pages can be obtained using the Add method.

Read-only.

Syntax

objInspector.ModifiedFormPages

objInspector    Required. An expression that returns an Inspector object.


MonthOfYear Property

Returns or sets which month of the year is valid for this recurrence pattern. Can be a number from 1 through 12. For example, setting this property to 5 and the RecurrenceType property to olRecursYearly would cause this recurrence pattern to occur every May.

Read/write Long.

Syntax

objRecurrencePattern.MonthOfYear

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.

Note   This property is only valid for recurrence patterns whose RecurrenceType property is set to olRecursYearly or olRecursYearNth.


Move Method

Moves an Outlook item to a new folder.

Syntax

object.Move(DestFldr)

object   Required. An expression that returns an Outlook object that belongs to the Items collection.

DestFldr   Required.An expression that returns a MAPIFolder object. The destination folder.


MoveTo Method

Moves the current folder to the specified destination folder.

Syntax

objMAPIFolder.MoveTo(DestFldr)

objMAPIFolder    Required. An expression that returns a MAPIFolder object. The current folder.

DestFldr Required.An expression that returns a MAPIFolder object. The destination folder for the folder that is being moved.


MoveTo Method Example

This example adds a new folder to the default Contacts folder, and then uses the MoveTo method to move it to the default Inbox folder.

Set myFolder = myNameSpace.GetDefaultFolder(olFolderContacts)

Set myNewFolder = myFolder.Folders.Add("My Contacts")

myNewFolder.MoveTo myNameSpace.GetDefaultFolder(olFolderInbox)


Name Property

Returns the display name for the object.

Read-only String for Recipient and UserProperty objects, read/write String for Action, FormDescription, and MAPIFolder objects.


NickName Property

Returns or sets the nickname for the contact.

Read/write String.

Syntax

objContactItem.Nickname

objContactItem    Required. An expression that returns a ContactItem object.


NoAging Property

True to not age the Outlook item.

Read/write Boolean.

Syntax

object.NoAging

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


NoEndDate Property

True if the recurrence pattern has no end date.

Read/write Boolean.

Syntax

objRecurrencePattern.NoEndDate

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.

Remarks

This property must be coordinated with other properties when setting up a recurrence pattern. If the PatternEndDate property or the Occurrences property is set, the pattern is considered to be finite and the NoEndDate property is False. If neither PatternEndDate nor Occurrences is set, the pattern is considered infinite and NoEndDate is True.


Number Property

Returns or sets the number for the form.

Read/write String.

Syntax

objFormDescription.Number

objFormDescription    Required. An expression that returns a FormDescription object.


Occurrences Property

Returns or sets the number of occurrences of the recurrence pattern. This property allows the definition of a recurrence pattern that is only valid for the specified number of subsequent occurrences. For example, you can set this property to 10 for a formal training course that will be held on the next ten Thursday evenings.

Read/write Long.

Syntax

objRecurrencePattern.Occurrences

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.

Remarks

This property must be coordinated with other properties when setting up a recurrence pattern. If the PatternEndDate property or the Occurrences property is set, the pattern is considered to be finite and the NoEndDate property is False. If neither PatternEndDate nor Occurrences is set, the pattern is considered infinite and NoEndDate is True.


OneOff Property

True if the form will be discarded after using once (one-off). False if the form is retained as a custom form.

Read/write Boolean.

Syntax

objFormDescription.OneOff

objFormDescription    Required. An expression that returns a FormDescription object.


OptionalAttendees Property

Returns the display string of optional attendees names for the appointment. This property corresponds to the MAPI property PR_DISPLAY_CC.

Read-only String.

Syntax

objAppointmentItem.OptionalAttendees

objAppointmentItem    Required. An expression that returns an AppointmentItem object.


Ordinal Property

Returns or sets the position in the view (ordinal) for the task.

Read/write Long.

Syntax

objTaskItem.Ordinal

objTaskItem    Required. An expression that returns a TaskItem object.


OrganizationalIDNumber Property

Returns or sets the organizational ID number for the contact.

Read/write String.

Syntax

objContactItem.OrganizationalIDNumber

objContactItem    Required. An expression that returns a ContactItem object.


OriginatorDeliveryReportRequested Property

True if the originator requested a delivery receipt on the mail message.

Read/write Boolean.

Syntax

objMailItem.OriginatorDeliveryReportRequested

objMailItem    Required. An expression that returns a MailItem object.


OtherAddress Property

Returns or sets the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddress

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property contains the full, unparsed other address for the contact.


OtherAddressCity Property

Returns or sets the city portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressCity

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherAddressCountry Property

Returns or sets the country portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressCountry

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherAddressPostalCode Property

Returns or sets the postal code portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressPostalCode

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherAddressPostOfficeBox Property

Returns or sets the post office box portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressPostOfficeBox

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherAddressState Property

Returns or sets the state portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressState

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherAddressStreet Property

Returns or sets the street portion of the other address for the contact.

Read/write String.

Syntax

objContactItem.OtherAddressStreet

objContactItem    Required. An expression that returns a ContactItem object.

Remarks

This property is parsed from the OtherAddress property, but may be changed or entered independently should it be parsed incorrectly. Note that any such changes or entries to this property will be overwritten by any subsequent changes or entries to OtherAddress.


OtherFaxNumber Property

Returns or sets the other fax number for the contact.

Read/write String.

Syntax

objContactItem.OtherFaxNumber

objContactItem    Required. An expression that returns a ContactItem object.


OtherTelephoneNumber Property

Returns or sets the other telephone number for the contact.

Read/write String.

Syntax

objContactItem.OtherTelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


Owner Property

Returns or sets the owner for the task. This is a free-form string field. Setting this property to someone other than the current user does not have the effect of delegating the task.

Read/write String.

Syntax

objTaskItem.Owner

objTaskItem    Required. An expression that returns a TaskItem object.


Ownership Property

Returns the ownership state of the task. Can be one of the following OlTaskOwnership constants: olDelegatedTask, olNewTask, or olOwnTask.

Read-only Long.

Syntax

objTaskItem.Ownership

objTaskItem    Required. An expression that returns a TaskItem object.


PagerNumber Property

Returns or sets the pager number for the contact.

Read/write String.

Syntax

objContactItem.PagerNumber

objContactItem    Required. An expression that returns a ContactItem object.


Parent Property

Returns the parent object of the specified object.

Read-only.

Syntax

object.Parent

object    Required. An expression that returns an Outlook object.


Password Property

Returns or sets the password for modifying the form.

Read/write String.

Syntax

objFormDescription.Password

objFormDescription    Required. An expression that returns a FormDescription object.


PathName Property

Returns the full path to the linked attached file. This property is only valid for linked files.

Read-only String.

Syntax

objAttachment.PathName

objAttachment    Required. An expression that returns an Attachment object.


PatternEndDate Property

Returns or sets the end date for the recurrence pattern.

Read/write Date.

Syntax

objRecurrencePattern.PatternEndDate

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.

Remarks

This property is optional but must be coordinated with other properties when setting up a recurrence pattern. If this property or the Occurrences property is set, the pattern is considered to be finite, and the NoEndDate property is False. If neither PatternEndDate nor Occurrences is set, the pattern is considered infinite and NoEndDate is True.


PatternStartDate Property

Returns or sets the start date for the recurrence pattern.

Read/write Date.

Syntax

objRecurrencePattern.PatternStartDate

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


PercentComplete Property

Returns or sets the percentage of the task completed at the current date and time.

Read/write Long.

Syntax

objTaskItem.PercentComplete

objTaskItem    Required. An expression that returns a TaskItem object.


PersonalHomePage Property

Returns or sets the URL of the personal Web page for the contact.

Read/write String.

Syntax

objContactItem.PersonalHomePage

objContactItem    Required. An expression that returns a ContactItem object.


Position Property

Returns or sets the position of the attachment within the body of the item.

Read/write Long.

Syntax

objAttachment.Position

objAttachment    Required. An expression that returns an Attachment object.


Prefix Property

Returns or sets the prefix (for example, "Re") to use with the subject of the item when the action is executed. Note that Outlook automatically adds a colon (:) to the value of the Prefix property when setting the subject of the item.

Read/write String.

Syntax

objAction.Prefix

objAction    Required. An expression that returns an Action object.


PrimaryTelephoneNumber Property

Returns or sets the primary telephone number for the contact.

Read/write String.

Syntax

objContactItem.PrimaryTelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


PrintOut Method

Prints the Outlook item using all default settings.

Syntax

object.PrintOut

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


Profession Property

Returns or sets the profession for the contact.

Read/write String.

Syntax

objContactItem.Profession

objContactItem    Required. An expression that returns a ContactItem object.


RadioTelephoneNumber Property

Returns or sets the radio telephone number for the contact.

Read/write String.

Syntax

objContactItem.RadioTelephoneNumber

objContactItem    Required. An expression that returns a ContactItem object.


ReadReceiptRequested Property

True if a read receipt has been requested by the sender. This property corresponds to the MAPI property PR_READ_RECEIPT_REQUESTED.

Read/write Boolean.

Syntax

objMailItem.ReadReceiptRequested

objMailItem    Required. An expression that returns a MailItem object.


ReceivedByEntryID Property

Returns the EntryID for the true recipient as set by the transport provider delivering the mail message. This property corresponds to the MAPI property PR_RECEIVED_BY_ENTRYID.

Read-only String.

Syntax

objMailItem.ReceivedByEntryID

objMailItem    Required. An expression that returns a MailItem object.


ReceivedByName Property

Returns display name of the true recipient for the mail message. This property corresponds to the MAPI property PR_RECEIVED_BY_NAME.

Read-only String.

Syntax

objMailItem.ReceivedByName

objMailItem    Required. An expression that returns a MailItem object.


ReceivedOnBehalfOfEntryID Property

Returns the EntryID of the user delegated to represent the recipient for the mail message. This property corresponds to the MAPI property PR_RCVD_REPRESENTING_ENTRYID.

Read-only String.

Syntax

objMailItem.ReceivedOnBehalfOfEntryID

objMailItem    Required. An expression that returns a MailItem object.


ReceivedOnBehalfOfName Property

Returns the display name of the user delegated to represent the recipient for the mail message. This property corresponds to the MAPI property PR_RCVD_REPRESENTING_NAME.

Read-only String.

Syntax

objMailItem.ReceivedOnBehalfOfName

objMailItem    Required. An expression that returns a MailItem object.


ReceivedTime Property

Returns or sets the date and time at which the mail message or post was received.

Read/write Date.

Syntax

object.ReceivedTime

object    Required. An expression that returns a MailItem or PostItem object.


RecipientReassignmentProhibited Property

True if the recipient cannot forward the mail message.

Read/write Boolean.

Syntax

objMailItem.RecipientReassignmentProhibited

objMailItem    Required. An expression that returns a MailItem object.


Recipients Property

Returns a Recipients  collection that represents all the recipients for the Outlook item.

Read-only.

Syntax

object.Recipients

object    Required. An expression that returns an AppointmentItem, MailItem, MeetingItem, PostItem, or TaskItem object.


RecurrenceType Property

Returns or sets the frequency of occurrences for the recurrence pattern. Can be one of the following OlRecurrenceType constants: olRecursDaily, olRecursWeekly, olRecursMonthly, olRecursMonthNth, olRecursYearly, or olRecursYearNth. Use the Interval property to specify the number of units of a given recurrence type between occurrences in the pattern.

Read/write Long.

Syntax

objRecurrencePattern.RecurrenceType

objRecurrencePattern   Required. An expression that returns a RecurrencePattern object.


ReferredBy Property

Returns or sets the referral name entry for the contact.

Read/write String.

Syntax

objContactItem.ReferredBy

objContactItem   Required. An expression that returns a ContactItem object.


ReminderMinutesBeforeStart Property

Returns or sets the number of minutes the reminder should occur prior to the start of the appointment.

Read/write Long.

Syntax

objAppointmentItem.ReminderMinutesBeforeStart

objAppointmentItem    Required. An expression that returns an AppointmentItem object.


ReminderOverrideDefault Property

True if the reminder overrides the default reminder behavior for the appointment, mail item, or task.

Read/write Boolean.

Syntax

object.ReminderOverrideDefault

object    Required. An expression that returns an AppointmentItem, MailItem, or TaskItem object.


ReminderPlaySound Property

True if the reminder should play a sound when it occurs for this appointment or task. This property is only valid if the ReminderOverrideDefault property is set to True.

Read/write Boolean.

Syntax

object.ReminderPlaySound

object    Required. An expression that returns an AppointmentItem, MailItem, or TaskItem object.


ReminderSet Property

True if a reminder has been set for this appointment, mail item or task.

Read/write Boolean.

Syntax

object.ReminderSet

object    Required. An expression that returns an AppointmentItem, MailItem, or TaskItem object.


ReminderSoundFile Property

Returns or sets the path and filename of the sound file to play when the reminder occurs for the appointment, mail message, or task. This property is only valid if the ReminderOverrideDefault and ReminderPlaySound properties are set to True.

Read/write String.

Syntax

object.ReminderSoundFile

object    Required. An expression that returns an AppointmentItem, MailItem, or TaskItem object.


ReminderTime Property

Returns or sets the date and time at which the reminder should occur for this item.

Read/write Date.

Syntax

object.ReminderTime

object    Required. An expression that returns a MailItem, MeetingItem or TaskItem object..


RemoteMessageClass Property

Returns the message class for the remote item.

Read-only String.

Syntax

objRemoteItem.RemoteMessageClass

objRemoteItem    Required. An expression that returns a RemoteItem object.


RemoteStatus Property

Returns or sets the remote status of the mail message. Can be one of the following OlRemoteStatus constants: olMarkedForCopy, olMarkedForDelete, olMarkedForDownload, olNone, or olUnMarked.

Read/write Long.

Syntax

objMailItem.RemoteStatus

objMailItem    Required. An expression that returns a MailItem object.


Remove Method

Removes the object from the collection.

Syntax

object.Remove(Index)

object   Required. An expression that returns an object in the Applies To list.

Index   Required Long. The index of the object within the collection.


Reply Method

Creates a reply, pre-addressed to the original sender, from the journal entry or mail message. Returns the reply as a MailItem object.

Syntax

object.Reply

object    Required. An expression that returns a JournalItem or MailItem object.


ReplyAll Method

Creates a reply to all original recipients from the journal entry or mail message. Returns the reply as a MailItem object.

Syntax

object.ReplyAll

object   Required. An expression that returns a JournalItem or MailItem object.


ReplyRecipientNames Property

Returns the semicolon-delimited list of reply recipients for the mail message. This property only contains the display names for the reply recipients. The reply recipients list should be set by using the ReplyRecipients collection.

Read-only String.

Syntax

objMailItem.ReplyRecipientNames

objMailItem    Required. An expression that returns a MailItem object.


ReplyRecipients Property

Returns a Recipients collection that represents all the reply recipient objects for the mail message.

Read-only Recipients.

Syntax

objMailItem.ReplyRecipients

objMailItem    Required. An expression that returns a MailItem object.


ReplyStyle Property

Returns or sets the text formatting reply style for the action. Can be one of the following OlActionReplyStyle constants: olEmbedOriginalItem, olIncludeOriginalText, olIndentOriginalText, olLinkOriginalItem, olOmitOriginalText, olReplyTickOriginalText or olUserPreference.

Read/write Long.

Syntax

objAction.ReplyStyle

objAction    Required. An expression that returns an Action object.


ReplyTime Property

Returns or sets the reply time for the appointment.

Read/write Date.

Syntax

objAppointmentItem.ReplyTime

objAppointmentItem    Required. An expression that returns an AppointmentItem object.


RequiredAttendees Property

Returns the semicolon-delimited string of required attendee names for the meeting appointment. This property only contains the display names for the required attendees. The attendee list should be set by using the Recipients collection.

Read/write String.

Syntax

objAppointmentItem.RequiredAttendees

objAppointmentItem    Required. An expression that returns an AppointmentItem object.


Resolve Method

Attempts to resolve a Recipient object against the AddressBook. Returns True if the object was resolved, False if it was not.

Syntax

objRecipient.Resolve

objRecipient    Required. An expression that returns a Recipient object.


ResolveAll Method

Attempts to resolve all the Recipient objects in the Recipients collection against the AddressBook. Returns True if all of the objects were resolved, False if one or more were not.

Syntax

objRecipient.ResolveAll

objRecipient    Required. An expression that returns a Recipient object.


Resolved Property

True if the recipient has been validated against the Address Book.

Read-only Boolean.

Syntax

objRecipient.Resolved

objRecipient    Required. An expression that returns a Recipient object.


Resources Property

Returns the semicolon-delimited string of resource names for the meeting. This property contains the display names only. The Recipients collection should be used to modify the resource recipients. Resources are added as BCC recipients to the collection.

Read/write String.

Syntax

objAppointmentItem.Resources

objAppointmentItem     Required. An expression that returns an AppointmentItem object.


ResponseRequested Property

True if the sender would like a response to the meeting request for the appointment.

Read/write Boolean.

Syntax

objAppointmentItem.ResponseRequested

objAppointmentItem     Required. An expression that returns an AppointmentItem object.


ResponseStatus Property

Returns or sets the overall status of the meeting for the current user for the appointment. Can be one of the following OlResponseStatus constants: olResponseAccepted, olResponseDeclined, olResponseNone, olResponseNotResponded, olResponseOrganized, or olResponseTentative.

Read/write Long.

Syntax

objAppointmentItem.ResponseStatus

objAppointmentItem     Required. An expression that returns an AppointmentItem object.


ResponseStyle Property

Returns or sets the response style used when the action is executed. Can be one of the following OlActionResponseStyle constants: olOpen, olPrompt, or olSend.

Read/write Long.

Syntax

objAction.ResponseStyle

objAction     Required. An expression that returns an Action object.


Save Method

Saves the Outlook item to the current folder or, if this is a new item, to the Outlook default folder for the item type.

Syntax

object.Save

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


SaveAsFile Method

Saves the attachment to the specified path.

Syntax

objAttachment.SaveAsFile(Path)

objAttachment   Required. An expression that returns an Attachment object.

Path   Required String. The location at which to save the attachment.


Saved Property

True if the Outlook item has not been modified since the last save.

Read-only Boolean.

Syntax

object.Saved

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


SaveSentMessageFolder Property

Returns or sets the MAPIFolder object that represents the folder in which a copy of the mail message will be saved upon being sent.

Read/write.

Syntax

objMailItem.SaveSentMessageFolder

objMailItem   Required. An expression that returns a MailItem object.


SchedulePlusPriority Property

Returns or sets the Microsoft Schedule+ priority for the task. Can be 1 through 9, A through Z, or A1 through Z9. Priority 1 is the highest. The default value is 3.

Read/write String.

Syntax

objTaskItem.SchedulePlusPriority

objTaskItem   Required. An expression that returns a TaskItem object.


SelectedMailingAddress Property

Returns or sets the type of the mailing address for the contact. Can be one of the following OlMailingAddress constants: olBusiness, olHome, olNone, or olOther.

Read/write Long.

Syntax

objContactItem.SelectedMailingAddress

objContactItem    Required. An expression that returns a ContactItem object.


Send Method

Sends the appointment, meeting item, mail message, or task.

Syntax

object.Send

object    Required. An expression that returns an AppointmentItem, MeetingItem, MailItem, or TaskItem object.


SenderName Property

Returns the display name of the sender for the mail message or post. This property corresponds to the MAPI property PR_SENDER_NAME.

Read-only String.

Syntax

objMailItem.SenderName

objMailItem   Required. An expression that returns a MailItem object.


Sensitivity Property

Returns or sets the sensitivity for the Outlook item. Can be one of the following OlSensitivity constants: olConfidential, olNormal, olPersonal, or olPrivate. This property corresponds to the MAPI property PR_SENSITIVITY.

Read/write Long.

Syntax

object.Sensitivity

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


SentOn Property

Returns the date on which the mail message or post was sent. This property corresponds to the MAPI property PR_CLIENT_SUBMIT_TIME.

Read-only Date.

Syntax

object.SentOn

object    Required. An expression that returns a MailItem or PostItem object.


SentOnBehalfOfName Property

Returns the display name for the intended sender of the mail message. This property corresponds to the MAPI property PR_SENT_REPRESENTING_NAME.

Read/write String.

Syntax

objMailItem.SentOnBehalfOfName

objMailItem    Required. An expression that returns a MailItem object.


ShowFormPage Method

Shows a form page in the inspector.

Syntax

objInspector.ShowFormPage(PageName)

objInspector   Required. An expression that returns an Inspector object.

PageName   Required String. The display name of the page to be shown.


ShowOn Property

Returns or sets the location where the action will be shown. Can be one of the following OlActionShowOn constants: olDontShow, olMenu, or olMenuAndToolbar.

Read/write Long.

Syntax

objAction.ShowOn

objAction   Required. An expression that returns an Action object.


Size Property

Returns the size (in bytes) of the Outlook item.

Read-only Long.

Syntax

object.Size

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


Spouse Property

Returns or sets the spouse name entry for the contact.

Read/write String.

Syntax

objContactItem.Spouse

objContactItem    Required. An expression that returns a ContactItem object.


Start Property

Returns or sets the starting date and time for the appointment or journal entry.

Read/write Date.

Syntax

object.Start

object   Required. An expression that returns an AppointmentItem or JournalItem object.


StartDate Property

Returns or sets the starting date and time for the task.

Read/write Date.

Syntax

objTaskItem.StartDate

objTaskItem    Required. An expression that returns a TaskItem object.


StartTime Property

Returns or sets the start time for a given occurrence of the recurrence pattern. This property is only valid for appointments.

Read/write Date.

Syntax

objRecurrencePattern.StartTime

objRecurrencePattern    Required. An expression that returns a RecurrencePattern object.


Status Property

Returns or sets the status for the task. Can be one of the following OlTaskStatus constants: olTaskComplete, olTaskDeferred, olTaskInProgress, olTaskNotStarted, or olTaskWaiting.

Read/write Long.

Syntax

objTaskItem.Status

objTaskItem     Required. An expression that returns a TaskItem object.


StatusOnCompletionRecipients Property

Returns the semicolon-delimited string of display names for recipients who will receive status upon completion of the task. This property is calculated from the Recipients property. Recipients returned by the StatusOnCompletionRecipients property correspond to BCC recipients in the Recipients collection.

Read-only String.

Syntax

objTaskItem.StatusOnCompletionRecipients

objTaskItem     Required. An expression that returns a TaskItem object.


StatusReport Method

Sends a status report to all CC recipients (recipients returned by the StatusUpdateRecipients property) with the current status for the task.

Syntax

objTaskItem.StatusReport

objTaskItem     Required. An expression that returns a TaskItem object.


StatusUpdateRecipients Property

Returns the semicolon-delimited string of display names for recipients who receive status updates for the task. This property is calculated from the Recipients property. Recipients returned by the StatusUpdateRecipients property correspond to CC recipients in the Recipients collection.

Read-only String.

Syntax

objTaskItem.StatusUpdateRecipients

objTaskItem     Required. An expression that returns a TaskItem object.


StoreID Property

Returns or sets the store ID for the folder.

Read-only String.

Syntax

objMAPIFolder.StoreID

objMAPIFolder     Required. An expression that returns a MAPIFolder object.


Subject Property

Returns or sets the subject for the Outlook item. This property corresponds to the MAPI property PR_SUBJECT.

Read/write String.

Syntax

object.Subject

object   Required. An expression that returns an Outlook object that belongs to the Items collection.

Note   The Subject property is the default property for Outlook items.


Suffix Property

Returns or sets the name suffix (such as Jr., III, or Ph.D.) for the contact.

Read/write String.

Syntax

objContactItem.Suffix

objContactItem     Required. An expression that returns a ContactItem object.

Note: The LastName, FirstName, MiddleName, and Suffix properties are parsed from the FullName property.


TeamTask Property

True if the task is a team task.

Read/write Boolean.

Syntax

objTaskItem.TeamTask

objTaskItem     Required. An expression that returns a TaskItem object.


TelexNumber Property

Returns or sets the telex number for the contact.

Read/write String.

Syntax

objContactItem.TelexNumber

objContactItem     Required. An expression that returns a ContactItem object.


Template Property

Returns or sets the name of the template for the form.

Read/write String.

Syntax

objFormDescription.Template

objFormDescription     Required. An expression that returns a FormDescription object.


Title Property

Returns or sets the title for the contact.

Read/write String.

Syntax

objContactItem.Title

objContactItem     Required. An expression that returns a ContactItem object.


To Property

Returns the semicolon-delimited list of display names for the To recipients for the Outlook item. This property contains the display names only. The To property corresponds to the MAPI property PR_DISPLAY_TO. The Recipients collection should be used to modify this property.

Read-only String.

Syntax

objMailItem.To

objMailItem     Required. An expression that returns a MailItem object.


Top Property

Returns or sets the position (in pixels) of the top horizontal edge of the note.

Read/write Long.

Syntax

objNoteItem.Top

objNoteItem     Required. An expression that returns a NoteItem object.


TotalWork Property

Returns or sets the total work for the task.

Read/write Long.

Syntax

objTaskItem.TotalWork

objTaskItem     Required. An expression that returns a TaskItem object.


TrackingStatus Property

Returns or sets the tracking status for the recipient. Can be one of the following OlTrackingStatus constants: olTrackingDelivered, olTrackingNone, olTrackingNotDelivered, olTrackingNotRead, olTrackingRead, olTrackingRecallFailure, olTrackingRecallSuccess, or olTrackingReplied.

Read/write Long.

Syntax

objRecipient.TrackingStatus

objRecipient     Required. An expression that returns a Recipient object.


TrackingStatusTime Property

Returns or sets the tracking status date and time for the recipient.

Read/write Date.

Syntax

objRecipient.TrackingStatusTime

objRecipient     Required. An expression that returns a Recipient object.


TransferSize Property

Returns the transfer size (in bytes) for the remote item.

Read-only Long.

Syntax

objRemoteItem.TransferSize

objRemoteItem     Required. An expression that returns a RemoteItem object.


TransferTime Property

Returns the transfer time (in seconds) for the remote item.

Read-only Long.

Syntax

objRemoteItem.TransferTime

objRemoteItem     Required. An expression that returns a RemoteItem object.


TTYTDDTelephoneNumber Property

Returns or sets the TTY/TDD telephone number for the contact.

Read/write String.

Syntax

objContactItem.TTYTDDTelephoneNumber

objContactItem     Required. An expression that returns a ContactItem object.


Type Property

Returns or sets the type of the object, as shown in the following table.

Object	Type
AddressEntry	The type of entry for this address such as an Internet Address, MacMail Address, or Microsoft Mail Address. Read/write String.
Attachment	Can be one of the following OlAttachmentType constants: olByReference, olByValue, olEmbeddedItem, or olOLE.  Read-only Long.
JournalItem	A free-form string field, usually containing the display name of the journalizing application (for example, "MSWord").  Read/write String.
NameSpace	The only supported type is "MAPI."  Read-only String.
Recipient (of JournalItem)	The OlJournalRecipientType constant: olAssociatedContact.  Read/write Long.
Recipient (of MailItem)	Can be one of the following OlMailRecipientType constants: olBCC, olCC, olOriginator, or olTo.  Read/write Long.
Recipient (of MeetingItem)	Can be one of the following OlMeetingRecipientType constants: olOptional, olOrganizer, olRequired, or olResource.  Read/write Long.
Recipient (of TaskItem)	Can be either of the following OlTaskRecipientType constants: olFinalStatus, or olUpdate.  Read/write Long.
UserProperty	Can be one of the following OlUserPropertyType constants: olCombination, olCurrency, olDateTime, olDuration, olFormula, olKeywords, olNumber, olPercent, olText, or olYesNo.  Read-only Long.


UnRead Property

True if the Outlook item has not been opened (read).

Read/write Boolean.

Syntax

object.UnRead

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


UnReadItemCount Property

Returns the number of unread items in the folder.

Read-only Long.

Syntax

objMAPIFolder.UnReadItemCount

objMAPIFolder    Required. An expression that returns a MAPIFolder object.


User1 Property

Returns or sets the first Microsoft Schedule+ user for the contact.

Read/write String.

Syntax

objContactItem.User1

objContactItem     Required. An expression that returns a ContactItem object.


User2 Property

Returns or sets the second Microsoft Schedule+ user for the contact.

Read/write String.

Syntax

objContactItem.User2

objContactItem     Required. An expression that returns a ContactItem object.


User3 Property

Returns or sets the third Microsoft Schedule+ user for the contact.

Read/write String.

Syntax

objContactItem.User3

objContactItem     Required. An expression that returns a ContactItem object.


User4 Property

Returns or sets the fourth Microsoft Schedule+ user for the contact.

Read/write String.

Syntax

objContactItem.User4

objContactItem     Required. An expression that returns a ContactItem object.


UserProperties Property

Returns the UserProperties collection that represents all the user properties for the Outlook item.

Read-only.

Syntax

object.UserProperties

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


UseWordMail Property

True to use Microsoft Word as the default editor for the form.

Read/write Boolean.

Syntax

objFormDescription.UseWordMail

objFormDescription   Required. An expression that returns a FormDescription object.


ValidationFormula Property

Returns or sets the validation formula for the user property. This property is just a descriptive string; it does not have any validation functionality.

Read/write String.

Syntax

objUserProperty.ValidationFormula

objUserProperty   Required. An expression that returns a UserProperty object.


ValidationText Property

Returns or sets the validation text for the user property.

Read/write String.

Syntax

objUserProperty.ValidationText

objUserProperty   Required. An expression that returns a UserProperty object.


Value Property

Returns or sets the value for the user property.

Read/write Variant.

Syntax

objUserProperty.Value

objUserProperty   Required. An expression that returns a UserProperty object.


Actions Property

Returns an Actions collection that represents all the available actions for the Outlook item.

Read-only.

Syntax

object.Actions

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


Version Property

Returns or sets the number of the version for the form.

Read/write String.

Syntax

objFormDescription.Version

objFormDescription    Required. An expression that returns a FormDescription object.


VotingOptions Property

Returns or sets a delimited string containing the voting options for the mail message.

Read/write String.

Syntax

objMailItem.VotingOptions

objMailItem    Required. An expression that returns a MailItem object.


VotingResponse Property

Returns or sets the voting response for the mail message. This property is usually set to one of the delimited values returned by the VotingOptions property on a reply to the original message.

Read/write String.

Syntax

objMailItem.VotingResponse

objMailItem    Required. An expression that returns a MailItem object.


WebPage Property

Returns or sets the URL of the Web page for the contact.

Read/write String.

Syntax

objContactItem.WebPage

objContactItem    Required. An expression that returns a ContactItem object.


Width Property

Returns or sets the width (in pixels) for the note.

Read/write Long.

Syntax

objNoteItem.Width

objNoteItem    Required. An expression that returns a NoteItem object.


YomiCompanyName Property

Returns or sets the Japanese phonetic rendering (yomigana) of the company name for the contact.

Read/write String.

Syntax

objContactItem.YomiCompanyName

objContactItem    Required. An expression that returns a ContactItem object.


YomiFirstName Property

Returns or sets the Japanese phonetic rendering (yomigana) of the first name for the contact.

Read/write String.

Syntax

objContactItem.YomiFirstName

objContactItem    Required. An expression that returns a ContactItem object.


YomiLastName Property

Returns or sets the Japanese phonetic rendering (yomigana) of the last name for the contact.

Read/write String.

Syntax

objContactItem.YomiLastName

objContactItem    Required. An expression that returns a ContactItem object.


FormDescription Object

Contains the general properties of an Outlook form. The properties of an Outlook form are displayed on the Properties page of a form in design mode. To see the Properties page in design mode, open the Outlook item, select Forms on the Tools menu, click Design This Form, and then click the Properties tab in the item's window.

Using the FormDescription Object

Use the FormDescription property to return the FormDescription object associated with an Outlook item.


PostItem Object

Represents a post in a public folder that others may browse. Unlike a MailItem object, a PostItem object is not sent to a recipient. You use the Post method, which is analogous to the Send method for the MailItem object, to save the PostItem to the target public folder instead of mailing it.

Using the PostItem Object

Use the CreateItem method to create a PostItem object that represents a new post. The following example returns a new post.

Set myItem = myOlApp.CreateItem(olPostItem)

Use Items(index), where index is the index number of a post or a value used to match the default property of a post, to return a single PostItem object from a public folder.


RemoteItem Object

Represents a remote item in an Inbox (mail) folder. The RemoteItem object is similar to the MailItem object, but it contains only the Subject, Received Date and Time, Sender, Size and the first 256 characters of the body of the message. It is used to give someone connecting in remote mode enough information to decide whether or not to download the corresponding mail message.

Using the RemoteItem Object

Unlike other Outlook objects, you cannot create this object. Remote items are created by Outlook automatically when you use a Remote Access System (RAS) connection. Each RemoteItem created on the local system corresponds to a pre-existing MailItem on the remote system.


ReportItem Object

Represents a mail-delivery report in an Inbox (mail) folder. The ReportItem object is similar to a MailItem object, and it contains a report (usually the non-delivery report) or error message from the mail transport system.

Using the ReportItem Object

Unlike other Outlook objects, you cannot create this object. Report items are created automatically when any report or error in general is received from the mail transport system.


Assign Method

Assigns a task and returns a TaskItem object that represents it. This method allows a task to be assigned (delegated) to another user. You must create a task before you can assign it, and you must assign a task before you can send it. An assigned task is sent as a TaskRequestItem object.

Syntax

objTaskItem.Assign

objTaskItem   Required. An expression that returns a TaskItem object.


CancelResponseState Method

Resets an unsent response to a task request back to a simple task. After you receive a task request and respond to it, but before sending the response, you can use this method to revert the task to its state before you responded.

Syntax

objTaskItem.CancelResponseState

objTaskItem   Required. An expression that returns a TaskItem object.


ClearConversationIndex Method

Clears the index of the conversation thread for the mail message or post.

Syntax

object.ClearConversationIndex

object   Required. An expression that returns a MailItem or PostItem object.


Close Method

For the Explorer object, the Close method closes the explorer. No information is saved.

For an Inspector or Outlook item object, the Close method closes the inspector or item and optionally saves changes to the displayed Outlook item.

Syntax 1

object.Close

Syntax 2

object.Close(SaveMode)

object     Required. An expression that returns an Explorer object (Syntax 1) or an Inspector or Outlook item object (Syntax 2).

SaveMode   Required Long. The close behavior. Can be one of the following OlInspectorClose constants: olDiscard (discard all changes without prompting), olPromptForSave (prompt to save or discard all changes), or olSave (save all changes without prompting). The default value is olDiscard. If the item displayed within the inspector has not been changed, this argument has no effect.


Post Method

Sends (posts) the PostItem object. The Post method, which is analogous to the Send method for the MailItem object, is used to save the post to the target public folder instead of mailing it.

Syntax

objPostItem.Post

objPostItem    Required. An expression that returns a PostItem object.


PublishForm Method

Saves the definition of the FormDescription object in the specified form registry.

Forms are registered as one of three classes: Folder, Organization, or Personal. The Folder form registry holds a set of forms that are only accessible from that specific folder, whether public or private. The Organization form registry holds forms that are shared across an entire enterprise and thus are accessible to everyone. The Personal form registry holds forms that are accessible only to the current store user.

Syntax

objFormDescription.PublishForm(Registry, Folder)

objFormDescription    Required. An expression that returns a FormDescription object.

Registry   Required Long. The form class. Can be one of the following OlFormRegistry constants: olDefaultRegistry, olFolderRegistry, olOrganizationRegistry, or olPersonalRegistry. Use olDefaultRegistry to handle items without regard to their form class.

Folder   Required. MAPIFolder. Used only with Folder form registry. The folder object from which the forms must be accessed.


Quit Method

Closes all currently open windows. The associated Outlook session is closed completely: the user is logged out of MAPI and any changes to items not already saved are discarded.

Syntax

objApplication.Quit

objApplication    Required. An expression that returns an Application object.


SaveAs Method

Saves the Outlook item to the specified path and in the format of the specified file type. If the file type is not specified, the MSG format is used.

Syntax

object.SaveAs(Path, [Type])

object   Required. An expression that returns an Outlook object that belongs to the Items collection.

Path   Required String. The path on which to save the item.

Type   Optional Variant. The file type to save. Can be one of the following OlSaveAsType constants: olDoc, olHTML, olMSG, olRTF, olTemplate, olTXT, olVCal, or VCard.


SetCurrentFormPage Method

Displays the specified form page in the inspector.

Syntax

objInspector.SetCurrentFormPage(PageName)

objInspector   Required. An expression that returns an Inspector object.

PageName   Required String. The display name of the form page.


SkipRecurrence Method

Clears the current instance of a recurring task and sets the recurrence to the next instance of that task.

Syntax

objTaskItem.SkipRecurrence

objTaskItem   Required. An expression that returns a TaskItem object.


StartTimer Method

Starts the timer on the journal entry. This method allows programmatic control of the timer function. The Duration, End and Start properties are automatically updated when the timer is stopped.

Syntax

objJournalItem.StartTimer

objJournalItem   Required. An expression that returns a JournalItem object.


StopTimer Method

Stops the timer on the journal entry. This method allows programmatic control of the timer function. The Duration, End and Start properties are automatically updated when the timer is stopped.

Syntax

objJournalItem.StopTimer

objJournalItem   Required. An expression that returns a JournalItem object.


AutoForwarded Property

True if the mail message was automatically forwarded.

Read/write Boolean.

Syntax

objMailItem.AutoForwarded

objMailItem   Required. An expression that returns a MailItem object.


FileName Property

Returns the file name of the attachment. Use this property in conjunction with the PathName property.

Read-only String.

Syntax

objAttachment.FileName

objAttachment   Required. An expression that returns an Attachment object.


Location Property

Returns or sets the specific office location (for example, Building 1 Room 1 or Suite 123) for the appointment. This property corresponds to the MAPI property PR_OFFICE_LOCATION.

Read/write String.

Syntax

objAppointmentItem.Location

objAppointmentItem   Required. An expression that returns an AppointmentItem object.


MeetingResponseStatus Property

Returns or sets the overall status of the response to the meeting request for the recipient. Can be one of the following OlResponseStatus constants: olResponseAccepted, olResponseDeclined, olResponseNone, olResponseNotResponded, olResponseOrganized, or olResponseTentative.

Read/write Long.

Syntax

objRecipient.MeetingResponseStatus

objRecipient   Required. An expression that returns a Recipient object.


OfficeLocation Property

Returns or sets the specific office location (for example, Building 1 Room 1 or Suite 123) for the contact. This property corresponds to the MAPI property PR_OFFICE_LOCATION.

Read/write String.

Syntax

objContactItem.OfficeLocation

objContactItem   Required. An expression that returns a ContactItem object.


OutlookInternalVersion Property

Returns the build number of the Outlook application for an Outlook item.

Read-only Long.

Syntax

object.OutlookInternalVersion

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


OutlookVersion Property

Returns the major and minor version number of the Outlook application for an Outlook item.

Read-only String.

Syntax

object.OutlookVersion

object   Required. An expression that returns an Outlook object that belongs to the Items collection.


ResponseState Property

Returns or sets the overall status of the response to the task request. Can be one of the following OlTaskResponse constants: olTaskAccept, olTaskAssign, olTaskDecline, or olTaskSimple.

Read/write Long.

Syntax

objTaskItem.ResponseState

objTaskItem   Required. An expression that returns a TaskItem object.


Role Property

Returns or sets the free-form text string associating the owner of a task with a role for the task.

Read/write String.

Syntax

objTaskItem.Role

objTaskItem   Required. An expression that returns a TaskItem object.


UserCertificate Property

Returns or sets the string containing the user's authentication certificate for the contact.

Read/write String.

Syntax

objContactItem.UserCertificate

objContactItem   Required. An expression that returns a ContactItem object.


Close Event

Occurs when the Inspector associated with an Outlook item is being closed. If you set the return value of this function to False, the close operation isn't completed and the inspector is left open.

Syntax

Function Item_Close()


Close Event Example

This example tests for the Close event and if the item has not been Saved, it uses the Save method to save the item without prompting the user.

Function Item_Close()

    If not myItem.Saved Then

        myItem.Save

    End If

End Function


CustomAction Event

Occurs when a custom action of an Outlook item executes. Both the original item and the newly-created item resulting from the custom action are passed to the event. If you set the return value of this function to False, the custom action is not completed.

Syntax

Function Item_CustomAction(Action As Object, Response As Object)

Action   Required. The custom action being executed.

Response   Required. The new item created in response to executing the custom action.


CustomAction Event Example

This example uses the CustomAction event to set a property on the response item.

Function Item_CustomAction(ByVal myAction, ByVal myResponse)

    Select Case myAction.Name

        Case "Action1"

            myResponse.Subject = "Changed by VB Script"

        Case Else

    End Select

End Function


CustomPropertyChange Event

Occurs when a custom property of an Outlook item is changed. The property name is passed to the procedure so that you can determine which custom property changed.

Syntax

Sub Item_CustomPropertyChange(Name As String)

Name   Required. The name of the custom property that was changed.


CustomPropertyChange Event Example

This example uses the CustomPropertyChange event to enable a control when a Boolean field is set to True.

Sub Item_CustomPropertyChange(ByVal myPropName)

    Select Case myPropName

        Case "RespondBy"

            Set myPropChg = myItem.GetInspector.ModifiedFormPages

            Set myCtrl = myPropChg("Page 2").Controls("DateToRespond")

            If myItem.UserProperties("RespondBy").Value Then

                myCtrl.Enabled = True

                myCtrl.Backcolor = 1

            Else

                myCtrl.Enabled = False

                myCtrl.Backcolor = 0

            End If

        Case Else

    End Select

End Sub


Forward Event

Occurs when the user selects the Forward action for an Outlook item. Both the original item and the newly-created item are passed to the event. If you set the return value of this function to False, the Forward action is not completed and the new item is not displayed.

Syntax

Function Item_Forward(Response As Object)

Response   Required. The item created in response to the event.


Forward Event Example

This example uses the Forward event to disable forwarding on an item by setting the return value to False and displays a message that the item may not be forwarded.

Function Item_Forward(ByVal myForwardItem)

    MsgBox "You may not forward this message!"

    Item_Forward = False

End Function


Open Event

Occurs when an Outlook item is being opened in an Inspector. When this event occurs, the Inspector object is initialized but not yet displayed. If you set the return value of this function to False, the open operation is not completed and the inspector is not displayed. The Open event differs from the Read event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an Inspector.

Syntax

Function Item_Open()


Open Event Example

This example uses the Open event to open an item in its inspector and display the "All Fields" page.

Function Item_Open()

    myItem.GetInspector.SetCurrentFormPage "All Fields"

End Function


PropertyChange Event

Occurs when a standard property (for example, Subject or To) of an Outlook item is changed. The property name is passed to the event so that you can determine which property was changed.

Syntax

Sub Item_PropertyChange(Name As String)

Name   Required. The name of the property that was changed.


PropertyChange Event Example

This example uses the PropertyChange event to disable the setting of a reminder on an item.

Sub Item_PropertyChange(ByVal myPropertyName)

    Select Case myPropertyName

        Case "ReminderSet"

            MsgBox "You may not set a reminder on this item!"

            myItem.ReminderSet = False

        Case Else

    End Select

End Sub


Read Event

Occurs when an existing Outlook item is opened for editing by the user. The Read event differs from the Open event in that Read occurs whenever the user selects the item in a view that supports in-cell editing as well as when the item is being opened in an Inspector.

Syntax

Sub Item_Read()


Read Event Example

This example uses the Read event to increment a counter that tracks how often an item is read.

Sub Item_Read()

    Set myProperty = myItem.UserProperties("ReadCount").Value

    myProperty.Value = myProperty.Value + 1

    myItem.Save

End Sub


Reply Event

Occurs when the user selects the Reply action for an Outlook item. Both the original item and the newly-created reply item are passed to the event. If you set the return value of this function to False, the Reply action is not completed and the new item is not displayed.

Syntax

Function Item_Reply(Response As Object)

Response   Required. The item created in response to the event.


Reply Event Example

This example uses the Reply event and sets the Sent Items folder for the reply item to the folder in which the original item resides.

Function Item_Reply(ByVal myResponse)

    Set myResponse.SaveSentMessageFolder = myItem.Parent

End Function


ReplyAll Event

Occurs when the user selects the ReplyAll action for an Outlook item. Both the original item and the newly-created reply item are passed to the event. If you set the return value of this function to False, the ReplyAll action is not completed and the new item is not displayed.

Syntax

Function Item_ReplyAll(Response As Object)

Response    Required. The item created in response to the event.


ReplyAll Event Example

This example uses the ReplyAll event and reminds the user that proceeding will reply to all original recipients of an item and, depending on the user's response, either allows the action to continue or stops it.

Function Item_ReplyAll(ByVal myResponse)

    myResult = MsgBox ("Do you really want to reply to all original _

        recipients?", 289, "Flame Protector")

    If myResult = 1 Then

        Item_ReplyAll = True

    Else

        Item_ReplyAll = False

    End If

End Function


Send Event

Occurs when the user selects the Send action for an Outlook item. If you set the return value of this function to False, the Send action is not completed and the item's Inspector is left open.

Syntax

Function Item_Send()


Send Event Example

This example uses the Send event and sends an item with an automatic expiration date of one week.

Function Item_Send()

    myItem.ExpiryTime = Date + 7

End Function


Write Event

Occurs when an Outlook item is saved, either explicitly (for example, using the Save or SaveAs methods) or implicitly (for example, in response to a prompt when closing the item's inspector). If you set the return value of this function to False, the save operation is not completed.

Syntax

Function Item_Write()


Write Event Example

This example uses the Write event and warns the user that the item is about to be saved and will overwrite any existing item and, depending on the user's response, either allows the operation to continue or stops it.

Function Item_Write()

    myResult = MsgBox ("The item is about to be saved. Do you wish _

        to overwrite the existing item?", 289, "Save")

    If myResult = 1 Then

        Item_Write = True

    Else

        Item_Write = False

    End If

End Function


Assign Method Example

This example uses CreateItem to create a simple task and delegate it as a task request to another user.

Set myItem = myOlApp.CreateItem(olTaskItem)

myItem.Assign

Set myDelegate = myItem.Recipients.Add("April LaMonte")

myItem.Subject = "Prepare Agenda For Meeting"

myItem.DueDate = #9/20/97#

myItem.Send


Close Method Example

This example uses CreateItem to open a mail message, add a recipient to it to introduce a change, get the Inspector for the item, then uses the Close method to close the inspector, and prompt the user to save changes.

Set myItem = = myOlApp.CreateItem(olMailItem)

myItem.Recipients.Add "David Goodhand"

Set myInspector = myItem.GetInspector

myInspector.Close olPromptForSave


CreateItemFromTemplate Method Example

This example uses CreateObject to create and display a new item and then uses CreateItemFromTemplate to create a new item from the Outlook Mail template.

Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItemFromTemplate("C:\Program

    Files\Microsoft Office\Templates\Outlook\Mail.oft")

myItem.Display


HideFormPage Method Example

This example uses HideFormPage to hide the Message page of the currently open item.

Set myInspector = myOlApp.ActiveInspector

myInspector.HideFormPage("Message")


IncludeRecurrences Property Example

This example uses IncludeRecurrences to demonstrate how to return a specific instance of a recurring appointment.

Set myItems = myOlApp.ActiveExplorer.CurrentFolder.Items

myItems.Sort "[Start]"

myItems.IncludeRecurrences = True

MsgBox "The fifth instance of the recurring appointment _

    occurs on:" & myItems.Item(5).Start


Logon Method Example

This example uses the Logon method to log on to a new session, displaying the dialog box to verify the profile name and password.

Set olNameSpace = myOlApp.GetNameSpace("MAPI")

olNameSpace.Logon "myProfile", "myPassword", True, True


MeetingStatus Property Example

This example uses CreateItem to create an appointment and uses MeetingStatus to set the meeting status to "Meeting" to turn it into a meeting request with both a required and an optional attendee.

Set myItem = myOlApp.CreateItem(olAppointmentItem)

Set myItem.MeetingStatus = olMeeting

myItem.Subject = "Strategy Meeting"

myItem.Location = "Conference Room B"

myItem.Start = #9/24/97 1:30:00 PM#

myItem.Duration = 90

Set myRequiredAttendee = myItem.Recipients.Add("Nate _

    Sun")

myRequiredAttendee.Type = olRequired

Set myOptionalAttendee = myItem.Recipients.Add("Kevin _

    Kennedy")

myOptionalAttendee.Type = olOptional

Set myResourceAttendee = _

    myItem.Recipients.Add("Conference Room B")

myResourceAttendee.Type = olResource

myItem.Send


Move Method Example

This example uses GetDefaultFolder to return the MAPIFolder object that represents the default folder. It then uses the Find and FindNext methods to find all messages sent by Mike Nash and uses the Move method to move all mail messages sent by Mike Nash from the default Inbox folder to the Personal Mail folder.

Set myInbox = myOlApp.GetDefaultFolder(olFolderInbox)

Set myItems = myInbox.Items

Set myDestFolder = myInbox.Folders("Personal Mail")

Set myItem = myItems.Find("[SenderName] = 'Mike Nash'")

While TypeName(myItem) <> "Nothing"

    myItem.Move myDestFolder

    Set myItem = myItems.FindNext

Wend


PublishForm Method Example

This example creates a contact, obtains its FormDescription object, and saves it in the Folder form registry of the default Contacts folder.

Set myFolder = _

    myNameSpace.GetDefaultFolder(olFolderContacts)

Set myItem = myOlApp.CreateItem(olContactItem)

Set myForm = myItem.FormDescription

myForm.Name = "My Contact"

myForm.PublishForm olFolderRegistry, myFolder

This example creates an appointment, obtains its FormDescription object, and saves it in the user's Personal form registry.

Set myItem = myOlApp.CreateItem(olAppointmentItem)

Set myForm = myItem.FormDescription

myForm.Name = "Interview Scheduler"

myForm.PublishForm olPersonalRegistry


Remove Method Example

This example uses the Remove method to remove all attachments from a forwarded message before sending it on to John Y. Chen.

Set myItem = myOlApp.ActiveInspector.CurrentItem.Forward

Set myAttachments = myItem.Attachments

While myAttachments.Count > 0

    myAttachments.Remove 1

Wend

myItem.Recipients.Add "John Y. Chen"

myItem.Send


Resolve Method Example

This example uses the Resolve method to attempt to resolve a recipient and, if unsuccessful, displays the item so a user can resolve it manually.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add("Tim O'Brien")

If Not myRecipient.Resolve Then myItem.Display


ResolveAll Method Example

This example uses the ResolveAll method to attempt to resolve all recipients and, if unsuccessful, displays a message box for each unresolved recipient.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipients = myItem.Recipients

myRecipients.Add("Aaron Con")

myRecipients.Add("Viki Parrott")

myRecipients.Add("Jeffrey Weems")

If Not myRecipients.ResolveAll Then

    For Each myRecipient In myRecipients

        If Not myRecipient.Resolved Then

            MsgBox myRecipient.Name

        End If

     Next

End If


Restrict Method Example

This example uses the Restrict method to get all Inbox items dealing with Project X and moves them to the Project X folder.

Set myFolder =  _

    myNameSpace.GetDefaultFolder(olFolderInbox)

Set my Items = myFolder.Items

Set myRestrictItems = myItems.Restrict("[Categories] = _

    'Project X'")

For Each myItem In myRestrictItems

    myItem.Move myFolder.Folders("Project X")

Next


SaveAs Method Example

This example uses the SaveAs method to save the currently open item as a text file in the My Documents folder, using the subject as the file name.

Set myItem = myOlApp.ActiveInspector.CurrentItem

myItem.SaveAs "C:\My Documents\" & myItem.Subject & _

    ".txt", olTXT


SaveAsFile Method Example

This example uses the SaveAsFile method to save the first attachment of the currently open item as a file in the My Documents folder, using the attachment's display name as the file name.

Set myItem = myOlApp.ActiveInspector.CurrentItem

Set myAttachments = myItem.Attachments

myAttachments.Item(1).SaveAsFile "C:\My Documents\" & _

    myAttachments.Item(1).DisplayName


ShowFormPage Method Example

This example uses the ShowFormPage method to show the All Fields page of the currently open item.

Set myInspector = myOlApp.ActiveInspector

myInspector.ShowFormPage("All Fields")


StatusReport Method Example

This example uses the StatusReport method to report the status of the currently open task.

Set myTask = myOlApp.ActiveInspector.CurrentItem

Set myReport = myTask.StatusReport

myReport.Send


Application Object

Represents the entire Microsoft Outlook application. This is the only object in the hierarchy that can be returned by using the CreateObject method or the intrinsic Visual Basic GetObject function.

The Outlook Application object has several purposes:

•	As the root object, it allows access to other objects in the Outlook hierarchy.

•	It allows direct access to a new item created by using CreateItem, without having to traverse the object hierarchy.

•	It allows access to the active interface objects (the explorer and the inspector)

Using the Application Object

When you use Automation to control Microsoft Outlook from another application, you use the CreateObject method to create an Outlook Application object. The following example starts Microsoft Outlook (if it's not already running) and opens the default Inbox folder.

Set myOlApp = CreateObject("Outlook.Application")

Set myNameSpace = myOlApp.GetNameSpace("MAPI")

Set myFolder= _

    myNameSpace.GetDefaultFolder(olFolderInbox)

myFolder.Display

The following example uses the Application object to create and open a new contact.

Set myOlApp = CreateObject("Outlook.Application")

Set myItem = myOlApp.CreateItem(olContactItem)

myItem.Display


Action Object

Represents a specialized action (for example, the voting options response) that can be executed on an item. The Action object is a member of the Actions collection.

Using the Action Object

Use Actions(index), where index is the name of an available action, to return a single Action object. The following example uses the "Reply" action of a particular item to send a reply.

Set myReply = myItem.Actions("Reply").Execute

The following example does the same thing, using a different reply style for the reply.

myItem.Actions("Reply").ReplyStyle = _

    olIncludeOriginalText

Set myReply = myItem.Actions("Reply").Execute


Actions Collection Object

A collection of Action objects that represent all the specialized actions that can be executed on an Outlook item.

Using the Actions Collection

Use the Actions property to return the Actions collection for any Outlook item object.

Use Actions(index), where index is the name of an available action, to return a single Action object. The following example uses the "Reply" action of a particular item to send a reply.

Set myReply = myItem.Actions("Reply").Execute


AppointmentItem Object

Represents an appointment in the Calendar folder. An AppointmentItem object can represent a meeting, a one-time appointment, or a recurring appointment or meeting.

Using the AppointmentItem Object

Use the CreateItem method to create an AppointmentItem object that represents a new appointment. The following example returns a new appointment.

Set myItem = myOlApp.CreateItem(olAppointmentItem)

Use Items(index), where index is the index number of an appointment or a value used to match the default property of an appointment, to return a single AppointmentItem object from a Calendar folder.

You can also return an AppointmentItem object from a MeetingItem object by using the GetAssociatedAppointment method.


Attachment Object

Represents a document or link to a document contained in an Outlook item.

Using the Attachment Object

Use Attachments(index), where index is the index number, to return a single Attachment object.

Use the Add method to add an attachment to an item. The following example creates a new mail message, attaches a Q496.xls as an attachment (not a link), and gives the attachment a descriptive caption.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAttachments = myItem.Attachments

myAttachments.Add "C:\My Documents\Q496.xls", _

    olByValue, 1, "4th Quarter 1996 Results Chart"


Attachments Collection Object

A collection of Attachment objects that represent the attachments in an Outlook item.

Using the Attachments Collection

Use the Attachments property to return the Attachments collection for any Outlook item (except notes).

Use the Add method to add an attachment to an item. The following example creates a new mail message, attaches a Q496.xls as an attachment (not a link), and gives the attachment a descriptive caption.

Set myItem = myOlApp.CreateItem(olMailItem)

Set myAttachments = myItem.Attachments

myAttachments.Add "C:\My Documents\Q496.xls", _

    olByValue, 1, "4th Quarter 1996 Results Chart"

Use Attachments(index), where index is the index number, to return a single Attachment object.


ContactItem Object

Represents a contact in a Contacts folder. A contact can represent any person with whom you have any personal or professional contact.

Using the ContactItem Object

Use the CreateItem method to create a ContactItem object that represents a new contact. The following example returns a new contact.

Set myItem = myOlApp.CreateItem(olContactItem)

Use Items(index), where index is the index number of a contact or a value used to match the default property of a contact, to return a single ContactItem object from a Contacts folder.


Explorer Object

Represents the window in which the contents of a folder are displayed.

Using the Explorer Object

Use the ActiveExplorer method to return the currently active explorer (if there is one).

Use the GetExplorer method to return the Explorer object associated with a folder.

Use the Display method to display a folder in its associated explorer.


Folders Collection Object

A collection of MAPIFolder objects that represent all the available Outlook folders.

Using the Folders Collection

Use the Folders property to return the Folders collection from a NameSpace object or another MAPIFolder object.

Use Folders(index), where index is the name or index number, to return a single MAPIFolder object. Folder names are case-sensitive. The following example returns the folder named "Inbox" from myFolder

Set myNewFolder = myFolder.Folders("Inbox")

The following example returns the first folder in myFolder.

Set myNewFolder = myFolder.Folders(1)


Inspector Object

Represents the window in which an Outlook item is displayed.

Using the Inspector Object

Use the ActiveExplorer method to return the currently active Inspector (if there is one).

Use the GetExplorer method to return the Inspector object associated with an item.

Use the Display method to display an item in its associated inspector.


Items Collection Object

A collection of Outlook item objects in a folder. Outlook item objects include the AppointmentItem, ContactItem, DocumentItem, JournalItem, MailItem, MeetingItem, NoteItem, PostItem, RemoteItem, ReportItem, TaskItem, TaskRequestAcceptItem, TaskRequestDeclineItem, TaskRequestUpdateItem, and TaskRequestItem objects.

Using the Items Collection

Use the Items property to return the Items collection of a MAPIFolder object.

Use Items(index), where index is the name or index number, to return a single Outlook item. The following example returns the first item with the subject "Need your advice" in myFolder.

Set myItem = myFolder.Items("Need your advice")

The following example returns the first item in myFolder.

Set myItem = myFolder.Items(1)


JournalItem Object

Represents a journal entry in a Journal folder. A journal entry represents a record of all Outlook-moderated transactions for any given period.

Using the JournalItem Object

Use the CreateItem method to create a JournalItem object that represents a new journal entry. The following example returns a new journal entry.

Set myItem = myOlApp.CreateItem(olJournalItem)

Use Items(index), where index is the index number of a journal entry or a value used to match the default property of a journal entry, to return a single JournalItem object from a Journal folder.


MailItem Object

Represents a mail message in an Inbox (mail) folder.

Using the MailItem Object

Use the CreateItem method to create a MailItem object that represents a new mail message. The following example creates and displays a new mail message.

Set myItem = myOlApp.CreateItem(olMailItem)

myItem.Display

Use Items(index), where index is the index number of a mail message or a value used to match the default property of a message, to return a single MailItem object from an Inbox folder. The following example sets the current folder as the Inbox and displays the second mail message in the folder.

Set myOlApp = CreateObject(“Outlook.Application”)

Set myNamespace = myOlApp.GetNamespace(“MAPI”)

Set myFolder =_ myNamespace.GetDefaultFolder(olFolderInbox)

myFolder.Display

Set myItem = myFolder.Items(1)

myItem.Display


MAPIFolder Object

Represents an Outlook folder. A MAPIFolder object can contain other MAPIFolder objects, as well as Outlook items. You can navigate nested folders by using a combination of Folders(index), which returns a folder within a name space or another folder, and the Parent property, which returns the containing object.

Using the MAPIFolder Object

Use Folders(index), where index is the name or index number, to return a single MAPIFolder object from a NameSpace object or another MAPIFolder object.

There is a set of folders within an Outlook data store that support the default functionality of Outlook. Use GetDefaultFolder(index), where index is one of the OlDefaultFolders constants (olFolderCalendar, olFolderContacts, olFolderDeletedItems, olFolderDrafts, olFolderInbox, olFolderJournal, olFolderNotes, olFolderOutbox, olFolderSentMail, olFolderTasks), to return one of the default Outlook folders in the Outlook NameSpace object.

Use the Add method to add a folder to the Folders collection. The Add method has an optional argument that can be used to specify the type of items that can be stored in that folder. By default, folders created inside another folder inherit the type of the parent folder.

Remarks

Folders within the Outlook data store can be typed; for example, the Calendar folder will only contain AppointmentItem objects and the Contacts folder will only contain ContactItem objects.

Note that when items of a specific type are saved, they are saved directly into their corresponding default folder. For example, when the GetAssociatedAppointment method is applied to a MeetingItem in the Inbox folder, the appointment that is returned will be saved to the default Calendar folder.


MeetingItem Object

Represents an item in an Inbox (mail) folder. A MeetingItem object represents a change to the recipient's Calendar folder initiated by another party or as a result of a group action.

Using the MeetingItem Object

Unlike other Outlook objects, you cannot create this object. It is created automatically when you set the MeetingStatus property of an AppointmentItem object to olMeeting and send it to one or more users. They receive it in their inboxes as a MeetingItem.

The following example uses the CreateItem method to create an appointment. It becomes a MeetingItem with both a required and an optional attendee when it is received in the inbox of each of the recipients.

Set myItem = myOlApp.CreateItem(olAppointmentItem)

myItem.MeetingStatus = olMeeting

myItem.Subject = "Strategy Meeting"

myItem.Location = "Conference Room B"

myItem.Start = #9/24/97 1:30:00 PM#

myItem.Duration = 90

Set myRequiredAttendee = myItem.Recipients.Add("Nate _

    Sun")

myRequiredAttendee.Type = olRequired

Set myOptionalAttendee = myItem.Recipients.Add("Kevin _

    Kennedy")

myOptionalAttendee.Type = olOptional

Set myResourceAttendee = _

    myItem.Recipients.Add("Conference Room B")

myResourceAttendee.Type = olResource

myItem.Send

Use the GetAssociatedAppointment method to return the AppointmentItem object associated with a MeetingItem object, and work directly with the AppointmentItem object to respond to the request.


NameSpace Object

Represents an abstract root object for any data source. The object itself provides methods for logging in and out, accessing storage objects directly by ID, accessing certain special default folders directly, and accessing data sources owned by other users.

Using the NameSpace Object

Use GetNameSpace("MAPI") to return the Outlook NameSpace object from the Application object.

Remarks

The only data source supported is "MAPI", which allows access to all Outlook data stored in MAPI.


NoteItem Object

Represents a note (an annotation attached to a document) in a Notes folder.

Using the NoteItem Object

Use the CreateItem method to create a NoteItem object that represents a new note. The following example returns a new note.

Set myItem = myOlApp.CreateItem(olNoteItem)

Use Items(index), where index is the index number of a note or a value used to match the default property of a note, to return a single NoteItem object from a Notes folder.


Pages Collection Object

A collection of pages that represent the pages of an inspector. Every Inspector object has a Pages collection defined, which is empty (count 0) if the Outlook item has never been customized before.

Using the Pages Collection

Use the ModifiedFormPages property to return the Pages collection from an Inspector object. The following example returns the Pages collection for the active inspector.

Set myPages = myItem.GetInspector.ModifiedFormPages

Use the Add method to create a custom page (you can add as many as 5 customizable pages). Use the Name argument of the Add method to set the display name of the returned page. In addition to adding custom pages, you can use the Name argument to return the main page of an Inspector object for modification.

The following example returns a custom page with a default name (such as "Custom1").

Set myPage = myPages.Add

The following example returns a custom page named "My Page."

Set myPage = myPages.Add("My Page")

The following example returns the Message page if the inspector contains a mail message.

Set myPage = myPages.Add("Message")

The following example returns the General (main) page if the inspector contains a contact.

Set myPage = myPages.Add("General")

Use ModifiedFormPages(index), where index is the name or index number, to return a single page from a Pages collection.


Recipient Object

Represents a user or resource in Outlook, generally a mail message addressee.

Using the Recipient Object

Use Recipients(index), where index is the name or index number, to return a single Recipient object.

Use the Add method to create a new Recipient object and add it to the Recipients collection. The Type property of a new Recipient object is set to the default for the associated AppointmentItem, JournalItem, MailItem or TaskItem object and must be reset to indicate another recipient type.

The following example creates a new MailItem object and adds "Jon Grande" as the recipient using the default type ("To").

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add ("Jon Grande")

The following example creates the same MailItem object as the preceding example, and then changes the type of the Recipient object from the default ("To") to "CC."

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add ("Jon Grande")

Set myRecipient.Type = olCC


Recipients Collection Object

The Recipients collection is a standard collection of Recipient objects.

Using the Recipients Collection

Use the Recipients property to return the Recipients collection of an AppointmentItem, JournalItem, MailItem or TaskItem object.

Use the Add method to create a new Recipient object and add it to the Recipients collection. The Type property of a new Recipient object is set to the default for the associated AppointmentItem, JournalItem, MailItem or TaskItem object and must be reset to indicate another recipient type.

The following example creates a new MailItem object and adds "Jon Grande" as the recipient using the default type ("To").

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add ("Jon Grande")

The following example creates the same MailItem object as the preceding example, and then changes the type of the Recipient object from the default ("To") to "CC."

Set myItem = myOlApp.CreateItem(olMailItem)

Set myRecipient = myItem.Recipients.Add ("Jon Grande")

Set myRecipient.Type = olCC

Use Recipients(index), where index is the name or index number, to return a single Recipient object.


RecurrencePattern Object

Represents the pattern of incidence of recurring appointments and tasks for the associated AppointmentItem and TaskItem object.

Using the RecurrencePattern Object

Use the GetRecurrencePattern method to return the RecurrencePattern object associated with an AppointmentItem or TaskItem object.

Remarks

Calling GetRecurrencePattern or ClearRecurrencePattern has the side effect of setting the IsRecurring property of the item accordingly. This property can be used as required for efficient filtering of the Items collection.

The type of recurrence pattern is indicated by the RecurrenceType property. The RecurrenceType property is the first property you should set.

The following properties are valid for all recurrence patterns: EndTime, Occurrences, StartDate, StartTime, or Type.

The following table shows the properties that are valid for the different recurrence types. The properties listed are not all required for the given type; an error occurs if the item is saved and the property is null or contains an invalid value. Monthly and yearly patterns are only valid for a single day. Weekly patterns are only valid as the Or of the DayOfWeekMask.

RecurrenceType	Properties	Example
olRecursDaily (one or the other property is required, not both)	Interval	Every N days
	DayOfWeekMask	Every Tuesday, Wednesday, and Thursday
olRecursMonthly	Interval	Every N months
	DayOfMonth	The Nth day of the month
olRecursMonthlyNth	Interval	Every N months
	Instance	The Nth Tuesday
	DayOfWeekMask	Every Tuesday and Wednesday
olRecursWeekly	Interval	Every N weeks
	DayOfWeekMask	Every Tuesday, Wednesday, and Thursday
olRecursYearly	DayOfMonth	The Nth day of the month
	MonthOfYear	February
olRecursYearlyNth	Instance	The Nth Tuesday
	DayOfWeekMask	Tuesday, Wednesday, Thursday
	MonthOfYear	February


TaskItem Object

Represents a task (an assigned, delegated, or self-imposed task to be performed within a specified time frame) in a Tasks folder.

Using The TaskItem Object

Use the CreateItem method to create a TaskItem object that represents a new task. The following example returns a new task.

Set myItem = myOlApp.CreateItem(olTaskItem)

Use Items(index), where index is the index number of a task or a value used to match the default property of a task, to return a single TaskItem object from a Tasks folder.


TaskRequestItem Object

Represents an item in an Inbox (mail) folder. A TaskRequestItem object represents a change to the recipient's Tasks list initiated by another party or as a result of a group tasking.

Using the TaskRequestItem Object

Unlike other Outlook objects, you cannot create this object. When the sender applies the Assign and Send methods to a TaskItem object to assign (delegate) the associated task to another user, the TaskRequestItem object is created when the item is received in the recipient’s inbox.

The following example creates a simple task, assigns it to another user, and sends it. When the task request arrives in the recipient’s inbox, it is received as a TaskRequestItem.

Set myItem = myOlApp.CreateItem(olTaskItem)

myItem.Assign

Set myDelegate = myItem.Recipients.Add("April LaMonte")

myItem.Subject = "Prepare Agenda For Meeting"

myItem.DueDate = #9/20/97#

myItem.Send

Use the GetAssociatedTask method to return the TaskRequestItem object, and work directly with the TaskItem object to respond to the request.


UserProperties Collection Object

A collection of UserProperty objects that represent the custom properties of an Outlook item.

Using The UserProperties Object

Use the UserProperties property to return the UserProperties collection for an Outlook item.

Use the Add method to create a new UserProperty for an item and adding it to the UserProperties collection. The Add method allows you to specify a name and type for the new property. The following example adds a custom text property named "MyPropName" to myItem.

Set myProp = myItem.UserProperties.Add("MyPropName", olText)

Use UserProperties(index), where index is a name or index number, to return a single UserProperty object.

Remarks

When you create a custom property, a field is added in the folder that contains the item (using the same name as the property). That field can be used as a column in folder views.


UserProperty Object

Represents a custom property of an Outlook item.

Using The UserProperty Object

Use UserProperties(index), where index is a name or index number, to return a single UserProperty object.

Use the Add method to create a new UserProperty for an item and add it to the UserProperties collection. The Add method allows you to specify a name and type for the new property. The following example adds a custom text property named "MyPropName" to myItem.

Set myProp = myItem.UserProperties.Add("MyPropName", olText)

Remarks

When you create a custom property, a field is added in the folder that contains the item (using the same name as the property). That field can be used as a column in folder views.